public class SubjectImpl extends Object implements Subject
Constructor and Description |
---|
SubjectImpl(String id1,
String name1,
String description1,
String typeName1,
String sourceId1)
Constructor called by SourceManager.
|
SubjectImpl(String id1,
String name1,
String description1,
String typeName1,
String sourceId1,
Map<String,Set<String>> attributes1)
Constructor called by SourceManager.
|
SubjectImpl(String id1,
String name1,
String description1,
String typeName1,
String sourceId1,
Map<String,Set<String>> attributes1,
String nameAttribute1,
String descriptionAttribute1)
Constructor called by SourceManager.
|
SubjectImpl(String id1,
String name1,
String description1,
String typeName1,
String sourceId1,
String nameAttribute1,
String descriptionAttribute1)
Constructor called by SourceManager.
|
Modifier and Type | Method and Description |
---|---|
static String |
attributeValueOrCommaSeparated(Subject subject,
String attributeName) |
static String |
attributeValueOrCommaSeparated(Subject subject,
String attributeName,
boolean excludeInternalAttributes) |
boolean |
equals(Object obj) |
static boolean |
equalsStatic(Subject subject,
Object obj) |
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 name1)
Returns the value of a single-valued attribute.
|
String |
getAttributeValue(String name1,
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 name1)
Returns the values of a multi-valued attribute, or a set of size one for a single valued attribute.
|
Set<String> |
getAttributeValues(String name1,
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 |
getDescriptionOverride() |
String |
getId()
Gets this Subject's ID.
|
String |
getName()
Gets this Subject's name.
|
String |
getNameOverride() |
Source |
getSource()
Returns the Source of this Subject.
|
String |
getSourceId()
sourceId
|
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() |
static int |
hashcodeStatic(Subject subject) |
static void |
initVirtualAttributes(Subject subject)
make sure the virtual attributes are setup for the subject
|
void |
setAttributes(Map<String,Set<String>> attributes1) |
void |
setDescription(String descriptionOverride) |
void |
setId(String id1) |
void |
setName(String nameOverride) |
void |
setSourceId(String sourceId1)
sourceId
|
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
|
void |
setTypeName(String typeName1) |
static Map<String,Set<String>> |
toAttributeMap(String... strings)
turn some strings into a map, every other is a name or value of attribute
|
String |
toString() |
static String |
toStringStatic(Subject subject)
toString
|
static Map<String,String> |
virtualAttributesForSource(Source source)
get the ordered list of virtual attributes for a source
|
static Map<String,String> |
virtualAttributeVariablesForSource(Source source)
get the ordered list of virtual attributes for a source
|
public SubjectImpl(String id1, String name1, String description1, String typeName1, String sourceId1)
id1
- name1
- description1
- typeName1
- sourceId1
- public SubjectImpl(String id1, String name1, String description1, String typeName1, String sourceId1, Map<String,Set<String>> attributes1)
id1
- name1
- description1
- typeName1
- sourceId1
- attributes1
- public SubjectImpl(String id1, String name1, String description1, String typeName1, String sourceId1, String nameAttribute1, String descriptionAttribute1)
id1
- name1
- description1
- typeName1
- sourceId1
- nameAttribute1
- descriptionAttribute1
- public SubjectImpl(String id1, String name1, String description1, String typeName1, String sourceId1, Map<String,Set<String>> attributes1, String nameAttribute1, String descriptionAttribute1)
id1
- name1
- description1
- typeName1
- sourceId1
- attributes1
- nameAttribute1
- descriptionAttribute1
- public static Map<String,Set<String>> toAttributeMap(String... strings)
strings
- public String toString()
toString
in class Object
Object.toString()
public static String toStringStatic(Subject subject)
subject
- public String getSourceId()
getSourceId
in interface Subject
public void setSourceId(String sourceId1)
sourceId1
- the sourceId to setpublic String getId()
public SubjectType getType()
public String getName()
public String getDescription()
getDescription
in interface Subject
public String getAttributeValue(String name1)
Subject
getAttributeValue
in interface Subject
Subject.getAttributeValue(java.lang.String, boolean)
public String getAttributeValue(String name1, 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 name1)
Subject
getAttributeValues
in interface Subject
Subject.getAttributeValues(java.lang.String)
public Set<String> getAttributeValues(String name1, boolean excludeInternalAttributes)
Subject
getAttributeValues
in interface Subject
excludeInternalAttributes
- if true, values for internal attributes are not returnedSubject.getAttributeValues(java.lang.String, boolean)
public Map<String,Object> getTranslationMap()
Subject
getTranslationMap
in interface Subject
public void setTranslationMap(Map<String,Object> translationMap)
Subject
setTranslationMap
in interface Subject
public static void initVirtualAttributes(Subject subject)
subject
- public static Map<String,String> virtualAttributeVariablesForSource(Source source)
source
- public static Map<String,String> virtualAttributesForSource(Source source)
source
- public Map<String,Set<String>> getAttributes()
Subject
getAttributes
in interface Subject
Subject.getAttributes()
public Map<String,Set<String>> getAttributes(boolean excludeInternalAttributes)
Subject
getAttributes
in interface Subject
excludeInternalAttributes
- if true, internal attributes are not returnedSubject.getAttributes(boolean)
public Source getSource()
public void setAttributes(Map<String,Set<String>> attributes1)
attributes1
- public String getTypeName()
Subject
getTypeName
in interface Subject
Subject.getTypeName()
public void setId(String id1)
id1
- the id to setpublic void setTypeName(String typeName1)
typeName1
- the typeName to setpublic boolean equals(Object obj)
equals
in class Object
Object.equals(java.lang.Object)
public static boolean equalsStatic(Subject subject, Object obj)
subject
- obj
- public int hashCode()
hashCode
in class Object
Object.hashCode()
public static int hashcodeStatic(Subject subject)
subject
- 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 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 static String attributeValueOrCommaSeparated(Subject subject, String attributeName)
subject
- shouldnt be nullattributeName
- Subject.getAttributeValueOrCommaSeparated(String)
public static String attributeValueOrCommaSeparated(Subject subject, String attributeName, boolean excludeInternalAttributes)
subject
- shouldnt be nullattributeName
- excludeInternalAttributes
- Subject.getAttributeValueOrCommaSeparated(String, boolean)
public String getAttributeValueSingleValued(String attributeName)
Subject
getAttributeValueSingleValued
in interface Subject
Subject.getAttributeValueSingleValued(java.lang.String)
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 String getNameOverride()
public void setName(String nameOverride)
nameOverride
- the nameOverride to setpublic String getDescriptionOverride()
public void setDescription(String descriptionOverride)
descriptionOverride
- the descriptionOverride to setCopyright © 2016 Internet2. All rights reserved.