Class Relationship
- java.lang.Object
-
- org.exoplatform.social.core.relationship.model.Relationship
-
public class Relationship extends Object
Relationship between 2 social identities
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRelationship.TypeThe Relationship Type Enum
-
Constructor Summary
Constructors Constructor Description Relationship(String uuid)Instantiates a new relationship.Relationship(Identity sender, Identity receiver)Instantiates a new relationship.Relationship(Identity sender, Identity receiver, Relationship.Type status)Instantiates a new relationship.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)Compares to this object return true if parameter object have the same id with thisStringgetId()Gets the id.IdentitygetPartner(Identity identity)Gets the partner of relationship.IdentitygetReceiver()Gets the receiver.IdentitygetSender()Gets the sender.Relationship.TypegetStatus()Gets the status.inthashCode()booleanisReceiver(Identity identity)Checks the identity is the receiver of relationshipbooleanisSender(Identity identity)Checks the identity is the sender of relationshipbooleanisSymetric()Sets the isSymetricvoidsetId(String id)Sets the id.voidsetReceiver(Identity receiver)Sets the receiver.voidsetSender(Identity sender)Sets the sender.voidsetStatus(Relationship.Type status)Sets the status.voidsetSymetric(boolean isSymetric)Gets the isSymetric.StringtoString()Gets string sender + "--[" + status + "]--" + receiver
-
-
-
Constructor Detail
-
Relationship
public Relationship(Identity sender, Identity receiver)
Instantiates a new relationship.- Parameters:
sender- the senderreceiver- the receiver
-
Relationship
public Relationship(Identity sender, Identity receiver, Relationship.Type status)
Instantiates a new relationship.- Parameters:
sender- the senderreceiver- the receiverstatus- the status
-
Relationship
public Relationship(String uuid)
Instantiates a new relationship.- Parameters:
uuid- the uuid
-
-
Method Detail
-
getSender
public Identity getSender()
Gets the sender.- Returns:
- the sender
-
getReceiver
public Identity getReceiver()
Gets the receiver.- Returns:
- the receiver
-
setSender
public void setSender(Identity sender)
Sets the sender.- Parameters:
sender- the new sender
-
setReceiver
public void setReceiver(Identity receiver)
Sets the receiver.- Parameters:
receiver- the new receiver
-
getId
public String getId()
Gets the id.- Returns:
- the id
-
setId
public void setId(String id)
Sets the id.- Parameters:
id- the new id
-
getStatus
public Relationship.Type getStatus()
Gets the status.- Returns:
- the status
-
setStatus
public void setStatus(Relationship.Type status)
Sets the status.- Parameters:
status- the new status
-
setSymetric
public void setSymetric(boolean isSymetric)
Gets the isSymetric.- Parameters:
isSymetric-
-
isSymetric
public boolean isSymetric()
Sets the isSymetric- Returns:
- isSymetric
-
toString
public String toString()
Gets string sender + "--[" + status + "]--" + receiver
-
getPartner
public Identity getPartner(Identity identity)
Gets the partner of relationship. Returns null if not found any identity in this relationship- Parameters:
identity-- Returns:
- identity
-
isSender
public boolean isSender(Identity identity)
Checks the identity is the sender of relationship- Parameters:
identity-- Returns:
- boolean
-
isReceiver
public boolean isReceiver(Identity identity)
Checks the identity is the receiver of relationship- Parameters:
identity-- Returns:
- boolean
-
equals
public boolean equals(Object obj)
Compares to this object return true if parameter object have the same id with this
-
-