2019-11-18 23:51:27 +01:00
|
|
|
package org.mercury_im.messenger.entity;
|
2019-11-03 06:33:52 +01:00
|
|
|
|
2020-06-15 17:41:13 +02:00
|
|
|
import org.jxmpp.jid.EntityBareJid;
|
|
|
|
import org.jxmpp.jid.impl.JidCreate;
|
|
|
|
|
2019-12-21 16:30:14 +01:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2020-05-16 15:53:54 +02:00
|
|
|
import lombok.Data;
|
|
|
|
|
2019-11-03 06:33:52 +01:00
|
|
|
/**
|
|
|
|
* User Account entity.
|
2020-10-24 19:25:28 +02:00
|
|
|
*/
|
2020-05-16 15:53:54 +02:00
|
|
|
@Data
|
|
|
|
public class Account {
|
2020-07-18 21:38:13 +02:00
|
|
|
|
|
|
|
static String EMPTY_ROSTER_VERSION = "";
|
|
|
|
|
2020-05-16 15:53:54 +02:00
|
|
|
UUID id;
|
|
|
|
String address;
|
|
|
|
String password;
|
|
|
|
String host;
|
|
|
|
int port;
|
|
|
|
boolean enabled;
|
2020-05-31 22:32:33 +02:00
|
|
|
String rosterVersion;
|
2020-05-23 12:01:31 +02:00
|
|
|
|
|
|
|
public Account() {
|
|
|
|
this.id = UUID.randomUUID();
|
2020-07-18 21:38:13 +02:00
|
|
|
this.rosterVersion = EMPTY_ROSTER_VERSION;
|
2020-05-23 12:01:31 +02:00
|
|
|
}
|
2020-06-15 17:41:13 +02:00
|
|
|
|
|
|
|
public EntityBareJid getJid() {
|
|
|
|
return JidCreate.entityBareFromOrThrowUnchecked(getAddress());
|
|
|
|
}
|
2019-11-03 06:33:52 +01:00
|
|
|
}
|