Improve entity constructors
This commit is contained in:
parent
80579e5e8d
commit
1a973fe725
|
@ -12,7 +12,11 @@ public class IAccount implements Account {
|
|||
protected boolean enabled;
|
||||
|
||||
public IAccount() {
|
||||
this.id = UUID.randomUUID();
|
||||
this(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public IAccount(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -13,7 +13,11 @@ public class IDirectChat implements DirectChat {
|
|||
protected ChatPreferences preferences;
|
||||
|
||||
public IDirectChat() {
|
||||
this.id = UUID.randomUUID();
|
||||
this(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public IDirectChat(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,11 @@ public class IGroupChat implements GroupChat {
|
|||
protected Set<Peer> participants;
|
||||
|
||||
public IGroupChat() {
|
||||
this.id = UUID.randomUUID();
|
||||
this(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public IGroupChat(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,7 +15,11 @@ public class IPeer implements Peer {
|
|||
protected boolean approved;
|
||||
|
||||
public IPeer() {
|
||||
this.id = UUID.randomUUID();
|
||||
this(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public IPeer(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -15,6 +15,13 @@ public class IMessage implements Message {
|
|||
protected MessageMetadata metadata;
|
||||
protected MessageDirection direction;
|
||||
|
||||
public IMessage() {
|
||||
this(UUID.randomUUID());
|
||||
}
|
||||
|
||||
public IMessage(UUID id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public UUID getId() {
|
||||
|
|
Loading…
Reference in New Issue