edu.internet2.middleware.grouper.ui.util
Class SubjectSortWrapper

java.lang.Object
  extended by edu.internet2.middleware.grouper.ui.util.SubjectSortWrapper
All Implemented Interfaces:
Subject, Serializable, Comparable

public class SubjectSortWrapper
extends Object
implements Subject, Comparable

See Also:
Serialized Form

Constructor Summary
SubjectSortWrapper(Subject subject)
          wrapped subject
 
Method Summary
 int compareTo(Object o)
           
 Map getAttributes()
          Gets a map attribute names and values.
 String getAttributeValue(String name)
          Returns the value of a single-valued attribute.
 String getAttributeValueOrCommaSeparated(String attributeName)
           Returns the attribute value if single-valued, or if multi-valued, returns the values comma separated (with a space too).
 Set getAttributeValues(String name)
          Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute.
 String getAttributeValueSingleValued(String attributeName)
          Returns the attribute value if single-valued, or if multi-valued, throws an exception.
 String getDescription()
          Gets this Subject's description.
 String getId()
          Gets this Subject's ID.
 String getName()
          Gets this Subject's name.
 String getScreenLabel()
          screen label (sort by this)
 Source getSource()
          Returns the Source of this Subject.
 String getSourceId()
          get the source id of a subject
 SubjectType getType()
          Gets this Subject's type.
 String getTypeName()
          get the type name
 Subject getWrappedSubject()
          return the wrapped subject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubjectSortWrapper

public SubjectSortWrapper(Subject subject)
wrapped subject

Parameters:
subject -
Method Detail

getScreenLabel

public String getScreenLabel()
screen label (sort by this)

Returns:
the screen label

getWrappedSubject

public Subject getWrappedSubject()
return the wrapped subject

Returns:
the wrapped subject

getAttributeValue

public String getAttributeValue(String name)
Description copied from interface: Subject
Returns the value of a single-valued attribute. If multivalued, this returns the first value

Specified by:
getAttributeValue in interface Subject
Returns:
value or null if not found
See Also:
Subject.getAttributeValue(java.lang.String)

getAttributeValues

public Set getAttributeValues(String name)
Description copied from interface: Subject
Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute. Note the returned set should not be changed.

Specified by:
getAttributeValues in interface Subject
Returns:
set or empty set or null if not there
See Also:
Subject.getAttributeValues(java.lang.String)

getAttributes

public Map getAttributes()
Description copied from interface: Subject
Gets a map attribute names and values. The map's key contains the attribute name and the map's value contains a Set of attribute value(s). The returned Map can be augmented or changed

Specified by:
getAttributes in interface Subject
Returns:
map or empty map or null if not there
See Also:
Subject.getAttributes()

getDescription

public String getDescription()
Description copied from interface: Subject
Gets this Subject's description.

Specified by:
getDescription in interface Subject
Returns:
description or null if not there
See Also:
Subject.getDescription()

getId

public String getId()
Description copied from interface: Subject
Gets this Subject's ID.

Specified by:
getId in interface Subject
Returns:
string
See Also:
Subject.getId()

getName

public String getName()
Description copied from interface: Subject
Gets this Subject's name.

Specified by:
getName in interface Subject
Returns:
name or null if not there
See Also:
Subject.getName()

getSource

public Source getSource()
Description copied from interface: Subject
Returns the Source of this Subject.

Specified by:
getSource in interface Subject
Returns:
source
See Also:
Subject.getSource()

getType

public SubjectType getType()
Description copied from interface: Subject
Gets this Subject's type.

Specified by:
getType in interface Subject
Returns:
subject type
See Also:
Subject.getType()

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

getAttributeValueOrCommaSeparated

public String getAttributeValueOrCommaSeparated(String attributeName)
Description copied from interface: Subject
 Returns the attribute value if single-valued, or
 if multi-valued, returns the values comma separated (with a space too).
 So if the values are: a b c; this would return the string: "a, b, c"
 Implementors can use the static helper in SubjectImpl
 

Specified by:
getAttributeValueOrCommaSeparated in interface Subject
Returns:
value or values or null if not there
See Also:
Subject.getAttributeValueOrCommaSeparated(java.lang.String)

getAttributeValueSingleValued

public String getAttributeValueSingleValued(String attributeName)
Description copied from interface: Subject
Returns the attribute value if single-valued, or if multi-valued, throws an exception. Implementors can use the static helper in SubjectImpl

Specified by:
getAttributeValueSingleValued in interface Subject
Returns:
value or null if not there
See Also:
Subject.getAttributeValueSingleValued(java.lang.String)

getSourceId

public String getSourceId()
Description copied from interface: Subject
get the source id of a subject

Specified by:
getSourceId in interface Subject
Returns:
the source id
See Also:
Subject.getSourceId()

getTypeName

public String getTypeName()
Description copied from interface: Subject
get the type name

Specified by:
getTypeName in interface Subject
Returns:
the type name
See Also:
Subject.getTypeName()