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.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final String`
`scope`
Scope of the attribute value.

## Constructor Summary

Constructors
Constructor
Description
`ScopedStringAttributeValue(String attributeValue, String valueScope)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
`String`
`getDisplayValue()`
Get a displayable form of the value for user interfaces and similar purposes.
`Object`
`getNativeValue()`
Get the native representation of the value of this attribute.
`final String`
`getScope()`
Get the scope of the value.
`int`
`hashCode()`
`String`
`toString()`
`static IdPAttributeValue`
`valueOf(String value, String scope)`
Returns an `EmptyAttributeValue` or `ScopedStringAttributeValue` as 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 Details

### scope

@Nonnull @NotEmpty private final String scope
Scope of the attribute value.

## Constructor Details

### ScopedStringAttributeValue

public ScopedStringAttributeValue(@Nonnull @NotEmpty @ParameterName(name="attributeValue") String attributeValue, @Nonnull @NotEmpty @ParameterName(name="valueScope") String valueScope)
Constructor.

Parameters:
  `attributeValue` - the value of the attribute
  `valueScope` - scope of the value

## Method Details

### getNativeValue

@Nonnull public Object getNativeValue()
Get the native representation of the value of this attribute.

Specified by:
  `getNativeValue` in interface `IdPAttributeValue`
Overrides:
  `getNativeValue` in class `StringAttributeValue`
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:
  `getDisplayValue` in interface `IdPAttributeValue`
Overrides:
  `getDisplayValue` in class `StringAttributeValue`
Returns:
  a displayable value

### equals

public boolean equals(@Nullable Object obj)

Overrides:
  `equals` in class `StringAttributeValue`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `StringAttributeValue`

### toString

public String toString()

Overrides:
  `toString` in class `StringAttributeValue`

### valueOf

@Nonnull public static IdPAttributeValue valueOf(@Nullable String value, @Nonnull @NotEmpty String scope)
Returns an `EmptyAttributeValue` or `ScopedStringAttributeValue` as appropriate. This method should be preferred over the constructor when the value may be null or empty.

Parameters:
  `value` - to inspect
  `scope` - of the value
Returns:
  `EmptyAttributeValue` or `ScopedStringAttributeValue`