2019-11-18 23:51:27 +01:00
|
|
|
package org.mercury_im.messenger.entity.contact;
|
2019-11-18 00:04:28 +01:00
|
|
|
|
2019-11-18 23:51:27 +01:00
|
|
|
import org.mercury_im.messenger.entity.Account;
|
2019-11-18 00:04:28 +01:00
|
|
|
|
2019-12-21 16:30:14 +01:00
|
|
|
import java.util.UUID;
|
|
|
|
|
2019-11-18 00:04:28 +01:00
|
|
|
/**
|
|
|
|
* Defines a user on the network (eg. a contact, chat partner, group chat member etc).
|
|
|
|
* Basically anyone that may send you a message is a Peer.
|
2019-12-06 20:48:27 +01:00
|
|
|
*
|
|
|
|
* An implementation can be found as {@link IPeer}.
|
2019-11-18 00:04:28 +01:00
|
|
|
*/
|
|
|
|
public interface Peer {
|
|
|
|
|
2019-12-21 16:30:14 +01:00
|
|
|
UUID getId();
|
2019-11-18 00:04:28 +01:00
|
|
|
|
2019-12-21 16:30:14 +01:00
|
|
|
void setId(UUID id);
|
2019-11-18 00:04:28 +01:00
|
|
|
|
|
|
|
Account getAccount();
|
|
|
|
|
|
|
|
void setAccount(Account account);
|
|
|
|
|
|
|
|
String getAddress();
|
|
|
|
|
|
|
|
void setAddress(String address);
|
|
|
|
|
|
|
|
String getName();
|
|
|
|
|
|
|
|
void setName(String name);
|
2019-12-02 00:37:35 +01:00
|
|
|
|
2019-12-21 05:34:19 +01:00
|
|
|
SubscriptionDirection getSubscriptionDirection();
|
2019-12-02 00:37:35 +01:00
|
|
|
|
2019-12-21 05:34:19 +01:00
|
|
|
void setSubscriptionDirection(SubscriptionDirection mode);
|
|
|
|
|
|
|
|
boolean isSubscriptionPending();
|
|
|
|
|
|
|
|
void setSubscriptionPending(boolean pending);
|
|
|
|
|
|
|
|
boolean isSubscriptionApproved();
|
|
|
|
|
|
|
|
void setSubscriptionApproved(boolean approved);
|
2019-12-02 00:37:35 +01:00
|
|
|
|
|
|
|
boolean isContact();
|
2019-12-21 16:47:41 +01:00
|
|
|
|
|
|
|
default String getDisplayName() {
|
|
|
|
return getName() != null ? getName() : getAddress();
|
|
|
|
}
|
2019-11-18 00:04:28 +01:00
|
|
|
}
|