WebSocketRange增加几个小方法
This commit is contained in:
@@ -18,35 +18,47 @@ import org.redkale.convert.json.JsonConvert;
|
||||
* @author zhangjx
|
||||
*/
|
||||
public class WebSocketRange implements Serializable {
|
||||
|
||||
|
||||
protected String wskey;
|
||||
|
||||
|
||||
protected Map<String, String> attach;
|
||||
|
||||
|
||||
public WebSocketRange() {
|
||||
}
|
||||
|
||||
|
||||
public WebSocketRange(String wskey) {
|
||||
this.wskey = wskey;
|
||||
}
|
||||
|
||||
|
||||
public WebSocketRange(String wskey, Map<String, String> attach) {
|
||||
this.wskey = wskey;
|
||||
this.attach = attach;
|
||||
}
|
||||
|
||||
|
||||
public boolean containsAttach(String key) {
|
||||
return this.attach == null ? false : this.attach.containsKey(key);
|
||||
}
|
||||
|
||||
public String getAttach(String key) {
|
||||
return this.attach == null ? null : this.attach.get(key);
|
||||
}
|
||||
|
||||
public String getAttach(String key, String defval) {
|
||||
return this.attach == null ? defval : this.attach.getOrDefault(key, defval);
|
||||
}
|
||||
|
||||
public String getWskey() {
|
||||
return wskey;
|
||||
}
|
||||
|
||||
|
||||
public void setWskey(String wskey) {
|
||||
this.wskey = wskey;
|
||||
}
|
||||
|
||||
|
||||
public Map<String, String> getAttach() {
|
||||
return attach;
|
||||
}
|
||||
|
||||
|
||||
public void setAttach(Map<String, String> attach) {
|
||||
this.attach = attach;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user