New file |
| | |
| | | package com.hdl.sdk.link.core.bean;
|
| | |
|
| | | import android.text.TextUtils;
|
| | |
|
| | | import androidx.annotation.NonNull;
|
| | |
|
| | | import com.hdl.sdk.link.common.utils.gson.GsonConvert;
|
| | |
|
| | | import java.io.Serializable;
|
| | |
|
| | | /**
|
| | | * Created by Tong on 2021/9/27.
|
| | | */
|
| | | public class LinkResponse implements Serializable {
|
| | |
|
| | | private String topic;
|
| | | private String data;
|
| | | private int length;
|
| | | private byte []byteData;
|
| | | private int code;
|
| | | private int msg;
|
| | |
|
| | | public String getTopic() {
|
| | | return topic;
|
| | | }
|
| | |
|
| | | public void setTopic(String topic) {
|
| | | this.topic = topic;
|
| | | }
|
| | |
|
| | | public String getData() {
|
| | | return data;
|
| | | }
|
| | |
|
| | | public void setByteData(byte []data) {
|
| | | this.byteData = data;
|
| | | this.data = new String(data);
|
| | | this.length=data.length;
|
| | | }
|
| | |
|
| | | public byte []getByteData() {
|
| | | return byteData;
|
| | | }
|
| | |
|
| | | public void setData(String data) {
|
| | | this.data = data;
|
| | | if (!TextUtils.isEmpty(data)) {
|
| | | this.byteData = data.getBytes();
|
| | | setLength(data.length());
|
| | | } else {
|
| | | setLength(0);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public int getLength() {
|
| | | return length;
|
| | | }
|
| | |
|
| | | private void setLength(int length) {
|
| | | this.length = length;
|
| | | }
|
| | |
|
| | | @NonNull
|
| | | @Override
|
| | | public String toString() {
|
| | | return GsonConvert.getGson().toJson(this);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 响应状态码
|
| | | * @return
|
| | | */
|
| | | public int getCode() {
|
| | | return code;
|
| | | }
|
| | |
|
| | | public void setCode(int code) {
|
| | | this.code = code;
|
| | | }
|
| | |
|
| | | /**
|
| | | * 响应消息
|
| | | * @return
|
| | | */
|
| | | public int getMsg() {
|
| | | return msg;
|
| | | }
|
| | |
|
| | | public void setMsg(int msg) {
|
| | | this.msg = msg;
|
| | | }
|
| | | }
|