All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.hn.im.easemob.comm.body.IMUserBody Maven / Gradle / Ivy

There is a newer version: 1.0.18
Show newest version
package com.hn.im.easemob.comm.body;

import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.databind.node.ContainerNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.hn.im.easemob.comm.wrapper.BodyWrapper;

public class IMUserBody implements BodyWrapper {
	
	private String userName;
	
	private String password;
	
	private String nickName;

	public IMUserBody(String nickName){this.nickName = nickName;}
	public IMUserBody(String userName, String password, String nickName) {
		super();
		this.userName = userName;
		this.password = password;
		this.nickName = nickName;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}

	@Override
	public ContainerNode getBody() {
		return JsonNodeFactory.instance.objectNode().put("username", userName).put("password", password).put("nickname", nickName);
	}

	@Override
	public Boolean validate() {
		return StrUtil.isNotBlank(userName) && StrUtil.isNotBlank(password);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy