package com.device.comm.mylibrary.NativeDevice.cgmadi.bean;


import com.device.comm.mylibrary.NativeDevice.cgmadi.enums.OBJCode;
import com.device.comm.mylibrary.NativeDevice.cgmadi.enums.OPCode;
import com.device.comm.mylibrary.NativeDevice.cgmadi.enums.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

//import static com.qlyd.device.R.string.Data;

public class RequestBean
  implements Serializable
{
  private static final long serialVersionUID = 1L;
  protected OPCode opCode;
  protected OBJCode objCode;
  protected Data data;
  protected byte[] params;
  protected int requestCode;
  protected int request;
  
  public RequestBean() {}
  
  public RequestBean(OPCode opCode, OBJCode objCode, int requestCode)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.requestCode = requestCode;
  }
  
  public RequestBean(OPCode opCode, OBJCode objCode, Data data, int requestCode)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.data = data;
    this.requestCode = requestCode;
  }
  
  public RequestBean(OPCode opCode, OBJCode objCode, Data data, byte[] params, int requestCode)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.data = data;
    this.params = params;
    this.requestCode = requestCode;
  }
  
  public RequestBean(OPCode opCode, OBJCode objCode, byte[] params, int requestCode)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.params = params;
    this.requestCode = requestCode;
  }
  
  public RequestBean(OPCode opCode, OBJCode objCode, int requestCode, int request)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.requestCode = requestCode;
    this.request = request;
  }
  
  public RequestBean(OPCode opCode, OBJCode objCode, Data data, int requestCode, int request)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.data = data;
    this.requestCode = requestCode;
    this.request = request;
  }
  
  public RequestBean(OPCode opCode, OBJCode objCode, byte[] params, int requestCode, int request)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.params = params;
    this.requestCode = requestCode;
    this.request = request;
  }
  
  public RequestBean(OPCode opCode, OBJCode objCode, Data data, byte[] params, int requestCode, int request)
  {
    this.opCode = opCode;
    this.objCode = objCode;
    this.data = data;
    this.params = params;
    this.requestCode = requestCode;
    this.request = request;
  }
  
  public OPCode getOpCode()
  {
    return this.opCode;
  }
  
  public void setOpCode(byte opCode) {}
  
  public OBJCode getObjCode()
  {
    return this.objCode;
  }
  
  public void setObjCode(byte objCode) {}
  
  public Data getData()
  {
    return this.data;
  }
  
  public void setData(Data data)
  {
    this.data = data;
  }
  
  public int getRequestCode()
  {
    return this.requestCode;
  }
  
  public void setRequestCode(int requestCode)
  {
    this.requestCode = requestCode;
  }
  
  public int getRequest()
  {
    return this.request;
  }
  
  public void setRequest(int request)
  {
    this.request = request;
  }
  
  public byte[] toTrancation()
  {
    List<Byte> list = new ArrayList();
    if (this.opCode != null) {
      list.add(this.opCode.getValue());
    }
    if (this.objCode != null) {
      list.add(this.objCode.getValue());
    }
    if (this.data != null) {
      list.add(this.data.getValue());
    }
    if (this.params != null) {
      byte[] arrayOfByte1;
      int j = (arrayOfByte1 = this.params).length;
      for (int i = 0; i < j; i++)
      {
        byte b = arrayOfByte1[i];
        list.add(Byte.valueOf(b));
      }
    }
    Byte[] array = (Byte[])list.toArray(new Byte[0]);
    byte[] rtn = new byte[array.length];
    for (int i = 0; i < array.length; i++) {
      rtn[i] = array[i].byteValue();
    }
    return rtn;
  }
}


/* Location:              /Users/lvwang2002/Desktop/CodeSource/work/DY_GLUCOSE/thapi_test/libs/cgmthapi.jar!/com/sanme/cgmadi/bluetooth4/bean/RequestBean.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */