public class LazySubject extends Object implements Subject
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)
Constructor and Description |
---|
LazySubject(Member member) |
LazySubject(Membership ms) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
Map |
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 name)
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 |
getAttributeValues(String name)
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.
|
Membership |
getMembership() |
String |
getName()
Gets this Subject's name.
|
Source |
getSource()
Returns the Source of this Subject.
|
String |
getSourceId()
get the source id
|
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
|
int |
hashCode() |
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 |
toString() |
public LazySubject(Membership ms)
ms
- public LazySubject(Member member)
member
- public String toString()
toString
in class Object
Object.toString()
public Map getAttributes()
Subject
getAttributes
in interface Subject
Subject.getAttributes()
public String getAttributeValue(String name)
Subject
getAttributeValue
in interface Subject
Subject.getAttributeValue(java.lang.String)
public Set getAttributeValues(String name)
Subject
getAttributeValues
in interface Subject
Subject.getAttributeValues(java.lang.String)
public String getDescription()
Subject
getDescription
in interface Subject
Subject.getDescription()
public String getId()
Subject
getId
in interface Subject
Subject.getId()
public String getName()
Subject
getName
in interface Subject
Subject.getName()
public Source getSource()
Subject
getSource
in interface Subject
Subject.getSource()
public String getSourceId()
getSourceId
in interface Subject
public SubjectType getType()
Subject
getType
in interface Subject
Subject.getType()
public boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public Membership getMembership()
public String getTypeName()
Subject
getTypeName
in interface Subject
Subject.getTypeName()
public String getAttributeValueOrCommaSeparated(String attributeName)
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
getAttributeValueOrCommaSeparated
in interface Subject
Subject.getAttributeValueOrCommaSeparated(java.lang.String)
public String getAttributeValueSingleValued(String attributeName)
Subject
getAttributeValueSingleValued
in interface Subject
Subject.getAttributeValueSingleValued(java.lang.String)
public String getAttributeValue(String attributeName, boolean excludeInternalAttributes)
Subject
getAttributeValue
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValue(java.lang.String, boolean)
public Set<String> getAttributeValues(String attributeName, boolean excludeInternalAttributes)
Subject
getAttributeValues
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValues(java.lang.String, boolean)
public String getAttributeValueOrCommaSeparated(String attributeName, boolean excludeInternalAttributes)
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
getAttributeValueOrCommaSeparated
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValueOrCommaSeparated(java.lang.String, boolean)
public String getAttributeValueSingleValued(String attributeName, boolean excludeInternalAttributes)
Subject
getAttributeValueSingleValued
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValueSingleValued(java.lang.String, boolean)
public Map<String,Set<String>> getAttributes(boolean excludeInternalAttributes)
Subject
getAttributes
in interface Subject
excludeInternalAttributes
- if true, internal attributes are not returnedSubject.getAttributes(boolean)
public Map<String,Object> getTranslationMap()
Subject
getTranslationMap
in interface Subject
public void setTranslationMap(Map<String,Object> translationMap)
Subject
setTranslationMap
in interface Subject
Copyright © 2016 Internet2. All rights reserved.