public interface Subject extends Serializable
A Subject represents an entity, such as a person, group, or organization. This class provides common characteristics and behaviors across these entities. Note, implementations of this interface shouldnt hold onto sources, since they arent serializable, they should lookup with AllSources Implementors should probably subclass SubjectImpl instead of implement this directly. Also, implementors should implement toString, equals and hashcode like Subject (based on sourceId and subjectId). There are static methods in subjectImpl which can be used as helper methods
Modifier and Type | Method and Description |
---|---|
Map<String,Set<String>> |
getAttributes()
Gets a map attribute names and values.
|
Map<String,Set<String>> |
getAttributes(boolean excludeInternalAttributes)
Gets a map attribute names and values.
|
String |
getAttributeValue(String attributeName)
Returns the value of a single-valued attribute.
|
String |
getAttributeValue(String attributeName,
boolean excludeInternalAttributes)
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).
|
String |
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).
|
Set<String> |
getAttributeValues(String attributeName)
Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute.
|
Set<String> |
getAttributeValues(String attributeName,
boolean excludeInternalAttributes)
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 |
getAttributeValueSingleValued(String attributeName,
boolean excludeInternalAttributes)
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.
|
Source |
getSource()
Returns the Source of this Subject.
|
String |
getSourceId()
get the source id of a subject
|
Map<String,Object> |
getTranslationMap()
we want to resolve virtual translated attributes when they are needed so store a map of subject and source attributes for that translation
|
SubjectType |
getType()
Gets this Subject's type.
|
String |
getTypeName()
get the type name
|
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 translation
|
String getId()
SubjectType getType()
String getTypeName()
String getSourceId()
String getName()
String getDescription()
String getAttributeValue(String attributeName)
attributeName
- Set<String> getAttributeValues(String attributeName)
attributeName
- String getAttributeValueSingleValued(String attributeName)
attributeName
- String getAttributeValueOrCommaSeparated(String attributeName)
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
attributeName
- Map<String,Set<String>> getAttributes()
String getAttributeValue(String attributeName, boolean excludeInternalAttributes)
attributeName
- excludeInternalAttributes
- if true, values for internal attributes are not returnedSet<String> getAttributeValues(String attributeName, boolean excludeInternalAttributes)
attributeName
- excludeInternalAttributes
- if true, values for internal attributes are not returnedString getAttributeValueSingleValued(String attributeName, boolean excludeInternalAttributes)
attributeName
- excludeInternalAttributes
- if true, values for internal attributes are not returnedString 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). 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
attributeName
- excludeInternalAttributes
- if true, values for internal attributes are not returnedMap<String,Set<String>> getAttributes(boolean excludeInternalAttributes)
excludeInternalAttributes
- if true, internal attributes are not returnedSource getSource()
Map<String,Object> getTranslationMap()
Copyright © 2016 Internet2. All rights reserved.