package com.hdl.sdk.connect.bean; import android.text.TextUtils; import androidx.annotation.NonNull; /** * Created by Tong on 2021/9/29. */ public class LinkRequest { private String topic; private String data; private int length; public LinkRequest() { } public LinkRequest(String topic, String data) { this.topic = topic; setData(data); } public String getTopic() { return topic; } public void setTopic(String topic) { this.topic = topic; } public String getData() { return data; } public void setData(String data) { this.data = data; if (!TextUtils.isEmpty(data)) { 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 "Topic:" + getTopic() + "\r\n" + "Length:" + getLength() + "\r\n\r\n" + getData(); } }