定义http协议头

package org.meal.util;

public class BLOCK_DATA {

	private String _mtype;         //主类型 2字符长度
    private String _subtype;       //次类型     2字符长度       
    private String shopid;  //五位商户号
    private String dataLen;      
    private String _DataBody;
    
    public String BLOCK2String(BLOCK_DATA bh)
    {
    	String tem="";
    	tem+=_subtype;
    	tem+=_mtype;
    	tem+=shopid;
    	tem+=dataLen;
    	tem+=_DataBody;
		return tem;
    	
    }
    

    public String chek;//校验数据位
    
    
	public String getShopid() {
		return shopid;
	}

	public void setShopid(String shopid) {
		this.shopid = shopid;
	}

	public String get_mtype() {
		return _mtype;
	}

	public void set_mtype(int _mtype) {
		this._mtype = String.format("%02d", _mtype);
	}

	public String get_subtype() {
		return _subtype;
	}

	public void set_subtype(int _subtype) {
		this._subtype =String.format("%02d", _subtype);;
	}

	public String getDataLen() {
		return dataLen;
	}

	public void setDataLen(String dataLen) {
		this.dataLen = dataLen;
	}

	public String get_DataBody() {
		return _DataBody;
	}

	public void set_DataBody(String _DataBody) {
		this._DataBody = _DataBody;
	}

	public String getChek() {
		return chek;
	}

	public void setChek(String chek) {
		this.chek = chek;
	}
    
    
}

其次定义常量
package org.meal.util;

public final  class Constants {

	//私有构造方法
    private Constants() {}
    public static final int LIVE = 1;
    public static final int BYE = 2;
    public static final int REFRESH = 3; //刷新功能
    public static final int STOP = 4;
    public static final int DATA = 5;  //数据
    public static final int PRINT = 6; //打印
    public static final int MENU = 7;  //菜单
}

复制代码

转载于:https://juejin.im/post/5c48301e51882522c03e9d52

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值