edu.vt.middleware.ed
Class GroupPersonRelation

java.lang.Object
  extended by edu.vt.middleware.ed.AbstractDataRelation<Group,V>
      extended by edu.vt.middleware.ed.AbstractGroupRelation<Person>
          extended by edu.vt.middleware.ed.GroupPersonRelation
All Implemented Interfaces:
DataObject, DataRelation<Group,Person>, GroupRelation<Person>, Serializable, Comparable<GroupPersonRelation>

public class GroupPersonRelation
extends AbstractGroupRelation<Person>
implements Comparable<GroupPersonRelation>, Serializable

Group-to-person relationship.

Version:
$Revision: 7971 $
Author:
Marvin S. Addison
See Also:
Serialized Form

Field Summary
static RoleType[] ALL_ROLES
          all supported roles
private static long serialVersionUID
          Serialization version marker
 
Fields inherited from class edu.vt.middleware.ed.AbstractDataRelation
createdBy, creationDate, dependent, expirationDate, owner, roleType, uid
 
Constructor Summary
GroupPersonRelation()
          Creates a bare group-to-person relationship.
GroupPersonRelation(Person p, RoleType role)
          Creates a group-to-person relationship with the given person of the specified role.
 
Method Summary
 int compareTo(GroupPersonRelation o)
          Sorts group-person relationships by the underlying account in each person, with a secondary sort by relation type code when the accounts are equal -- needed to keep all entries when the retrieval of relations is not limited by a role.
 Person getPerson()
          Gets the person involved in the relationship.
 Long getUid()
          This returns the uid.
 void setPerson(Person p)
          Sets the person involved in the relationship.
 
Methods inherited from class edu.vt.middleware.ed.AbstractGroupRelation
getGroup, setGroup
 
Methods inherited from class edu.vt.middleware.ed.AbstractDataRelation
compareTo, getCreatedBy, getCreationDate, getExpirationDate, getRelation, getRelationship, getRoleType, setCreatedBy, setCreationDate, setExpirationDate, setRelation, setRelationship, setRoleType, setUid, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.vt.middleware.ed.DataRelation
getExpirationDate, getRelation, getRelationship, getRoleType, setExpirationDate, setRelation, setRelationship, setRoleType
 
Methods inherited from interface edu.vt.middleware.ed.DataObject
getCreatedBy, getCreationDate, setCreatedBy, setCreationDate, setUid
 

Field Detail

ALL_ROLES

public static final RoleType[] ALL_ROLES
all supported roles


serialVersionUID

private static final long serialVersionUID
Serialization version marker

See Also:
Constant Field Values
Constructor Detail

GroupPersonRelation

public GroupPersonRelation()
Creates a bare group-to-person relationship.


GroupPersonRelation

public GroupPersonRelation(Person p,
                           RoleType role)
Creates a group-to-person relationship with the given person of the specified role. Sets the created date to current system date for convenience.

Parameters:
p - Person to whom a group should be related.
role - Role describing relationship of group to person.
Method Detail

getUid

public Long getUid()
This returns the uid.

Specified by:
getUid in interface DataObject
Returns:
Long - uid

getPerson

public Person getPerson()
Gets the person involved in the relationship.

Returns:
Person side of relationship.

setPerson

public void setPerson(Person p)
Sets the person involved in the relationship.

Parameters:
p - Person side of relationship.

compareTo

public int compareTo(GroupPersonRelation o)
Sorts group-person relationships by the underlying account in each person, with a secondary sort by relation type code when the accounts are equal -- needed to keep all entries when the retrieval of relations is not limited by a role.

Specified by:
compareTo in interface Comparable<GroupPersonRelation>
Parameters:
o - Relation to compare with this one.
Returns:
A negative integer, 0, or positive integer depending on whether the person account of the given relation is less than, equal to, or greater than that of this object.


Copyright © 2008 Virginia Tech. All Rights Reserved.