Class LazySubject
java.lang.Object
edu.internet2.middleware.grouper.subj.LazySubject
- All Implemented Interfaces:
Subject
,Serializable
Subject
from a Membership
- getMember().getSubject()
only called if necessary i.e. the UI pages results and so it is often not
necessary to instantiate all the Subjects (and Members)
- Version:
- $Id: LazySubject.java,v 1.11 2009-10-31 16:27:12 mchyzer Exp $
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Gets a map attribute names and values.getAttributes
(boolean excludeInternalAttributes) Gets a map attribute names and values.getAttributeValue
(String name) Returns the value of a single-valued attribute.getAttributeValue
(String attributeName, boolean excludeInternalAttributes) Returns the value of a single-valued attribute.getAttributeValueOrCommaSeparated
(String attributeName) Returns the attribute value if single-valued, or if multi-valued, returns the values comma separated (with a space too).getAttributeValueOrCommaSeparated
(String attributeName, boolean excludeInternalAttributes) Returns the attribute value if single-valued, or if multi-valued, returns the values comma separated (with a space too).getAttributeValues
(String name) Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute.getAttributeValues
(String attributeName, boolean excludeInternalAttributes) Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute.getAttributeValueSingleValued
(String attributeName) Returns the attribute value if single-valued, or if multi-valued, throws an exception.getAttributeValueSingleValued
(String attributeName, boolean excludeInternalAttributes) Returns the attribute value if single-valued, or if multi-valued, throws an exception.Gets this Subject's description.getId()
Gets this Subject's ID.getName()
Gets this Subject's name.Returns the Source of this Subject.get the source idwe want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translationgetType()
Gets this Subject's type.get the type nameint
hashCode()
boolean
void
setResolvedFromSource
(boolean isResolvedFromSource) true if resolved from source (rather than cache)void
setTranslationMap
(Map<String, Object> translationMap) we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translationtoString()
-
Constructor Details
-
LazySubject
-
LazySubject
- Parameters:
ms
-
-
LazySubject
- Parameters:
member
-
-
-
Method Details
-
toString
-
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). This does not return internal attributes. Note, the keys are case-insensitive- Specified by:
getAttributes
in interfaceSubject
- Returns:
- map or empty map or null if not there
- See Also:
-
getAttributeValue
Description copied from interface:Subject
Returns the value of a single-valued attribute. If multivalued, this returns the first value. This does not return values for internal attributes. Note, the keys are case-insensitive- Specified by:
getAttributeValue
in interfaceSubject
- Returns:
- value or null if not found
- See Also:
-
getAttributeValues
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. This does not return values for internal attributes. Note, the keys are case-insensitive- Specified by:
getAttributeValues
in interfaceSubject
- Returns:
- set or empty set or null if not there
- See Also:
-
getDescription
Description copied from interface:Subject
Gets this Subject's description.- Specified by:
getDescription
in interfaceSubject
- Returns:
- description or null if not there
- See Also:
-
getId
Description copied from interface:Subject
Gets this Subject's ID. -
getName
Description copied from interface:Subject
Gets this Subject's name. -
getSource
Description copied from interface:Subject
Returns the Source of this Subject. -
getSourceId
get the source id- Specified by:
getSourceId
in interfaceSubject
- Returns:
- the soruce id
-
getType
Description copied from interface:Subject
Gets this Subject's type. -
equals
-
hashCode
public int hashCode() -
getMembership
- Returns:
- membership
-
getTypeName
Description copied from interface:Subject
get the type name- Specified by:
getTypeName
in interfaceSubject
- Returns:
- the type name
- See Also:
-
getAttributeValueOrCommaSeparated
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. This does not return values for internal attributes. Note, the keys are case-insensitive
- Specified by:
getAttributeValueOrCommaSeparated
in interfaceSubject
- Returns:
- value or values or null if not there
- See Also:
-
getAttributeValueSingleValued
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. This does not return values for internal attributes. Note, the keys are case-insensitive- Specified by:
getAttributeValueSingleValued
in interfaceSubject
- Returns:
- value or null if not there
- See Also:
-
getAttributeValue
Description copied from interface:Subject
Returns the value of a single-valued attribute. If multivalued, this returns the first value. Note, the keys are case-insensitive- Specified by:
getAttributeValue
in interfaceSubject
excludeInternalAttributes
- if true, values for internal attributes are not returned- Returns:
- value or null if not found
- See Also:
-
getAttributeValues
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. Note, the keys are case-insensitive- Specified by:
getAttributeValues
in interfaceSubject
excludeInternalAttributes
- if true, values for internal attributes are not returned- Returns:
- set or empty set or null if not there
- See Also:
-
getAttributeValueOrCommaSeparated
public String getAttributeValueOrCommaSeparated(String attributeName, boolean excludeInternalAttributes) 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. Note, the keys are case-insensitive
- Specified by:
getAttributeValueOrCommaSeparated
in interfaceSubject
excludeInternalAttributes
- if true, values for internal attributes are not returned- Returns:
- value or values or null if not there
- See Also:
-
getAttributeValueSingleValued
public String getAttributeValueSingleValued(String attributeName, boolean excludeInternalAttributes) 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. Note, the keys are case-insensitive- Specified by:
getAttributeValueSingleValued
in interfaceSubject
excludeInternalAttributes
- if true, values for internal attributes are not returned- Returns:
- value or null if not there
- See Also:
-
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. Note, the keys are case-insensitive- Specified by:
getAttributes
in interfaceSubject
- Parameters:
excludeInternalAttributes
- if true, internal attributes are not returned- Returns:
- map or empty map or null if not there
- See Also:
-
getTranslationMap
Description copied from interface:Subject
we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translation- Specified by:
getTranslationMap
in interfaceSubject
- Returns:
-
setTranslationMap
Description copied from interface:Subject
we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translation- Specified by:
setTranslationMap
in interfaceSubject
-
isResolvedFromSource
public boolean isResolvedFromSource()- Specified by:
isResolvedFromSource
in interfaceSubject
- Returns:
- true if resolved from source (rather than cache)
-
setResolvedFromSource
public void setResolvedFromSource(boolean isResolvedFromSource) true if resolved from source (rather than cache)- Specified by:
setResolvedFromSource
in interfaceSubject
- Parameters:
isResolvedFromSource
-
-