Package net.shibboleth.idp.attribute
Class ScopedStringAttributeValue
- java.lang.Object
-
- net.shibboleth.idp.attribute.StringAttributeValue
-
- net.shibboleth.idp.attribute.ScopedStringAttributeValue
-
- All Implemented Interfaces:
Comparable<IdPAttributeValue>,IdPAttributeValue
@ThreadSafe public final class ScopedStringAttributeValue extends StringAttributeValue
An attribute value with an associated scope.
-
-
Constructor Summary
Constructors Constructor Description ScopedStringAttributeValue(String attributeValue, String valueScope)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetDisplayValue()Get a displayable form of the value for user interfaces and similar purposes.ObjectgetNativeValue()Get the native representation of the value of this attribute.StringgetScope()Get the scope of the value.inthashCode()StringtoString()static IdPAttributeValuevalueOf(String value, String scope)Returns anEmptyAttributeValueorScopedStringAttributeValueas appropriate.-
Methods inherited from class net.shibboleth.idp.attribute.StringAttributeValue
getValue, valueOf
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.shibboleth.idp.attribute.IdPAttributeValue
compareTo
-
-
-
-
Field Detail
-
scope
private final String scope
Scope of the attribute value.
-
-
Constructor Detail
-
ScopedStringAttributeValue
public ScopedStringAttributeValue(@Nonnull @NotEmpty @ParameterName(name="attributeValue") String attributeValue, @Nonnull @NotEmpty @ParameterName(name="valueScope") String valueScope)
Constructor.- Parameters:
attributeValue- the value of the attributevalueScope- scope of the value
-
-
Method Detail
-
getNativeValue
public Object getNativeValue()
Get the native representation of the value of this attribute.- Specified by:
getNativeValuein interfaceIdPAttributeValue- Overrides:
getNativeValuein classStringAttributeValue- Returns:
- the attribute value in native format.
-
getScope
@Nonnull @NotEmpty public final String getScope()
Get the scope of the value.- Returns:
- scope of the value
-
getDisplayValue
@Nonnull @NotEmpty public String getDisplayValue()
Get a displayable form of the value for user interfaces and similar purposes.- Specified by:
getDisplayValuein interfaceIdPAttributeValue- Overrides:
getDisplayValuein classStringAttributeValue- Returns:
- a displayable value
-
equals
public boolean equals(@Nullable Object obj)- Overrides:
equalsin classStringAttributeValue
-
hashCode
public int hashCode()
- Overrides:
hashCodein classStringAttributeValue
-
toString
@Nonnull @NotEmpty public String toString()
- Overrides:
toStringin classStringAttributeValue
-
valueOf
public static IdPAttributeValue valueOf(@Nullable String value, @Nonnull @NotEmpty String scope)
Returns anEmptyAttributeValueorScopedStringAttributeValueas appropriate. This method should be preferred over the constructor when the value may be null or empty.- Parameters:
value- to inspectscope- of the value- Returns:
EmptyAttributeValueorScopedStringAttributeValue
-
-