Package net.shibboleth.idp.attribute

# Class StringAttributeValue

java.lang.Object
net.shibboleth.idp.attribute.StringAttributeValue

All Implemented Interfaces:
  `Comparable<IdPAttributeValue>`, `IdPAttributeValue`

Direct Known Subclasses:
  `ScopedStringAttributeValue`

public class StringAttributeValue extends Object implements IdPAttributeValue
Base class for `IdPAttribute` values that are strings.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final String`
`value`
The attribute value.

## Constructor Summary

Constructors
Constructor
Description
`StringAttributeValue(String attributeValue)`
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`
`getValue()`
Return the value.
`int`
`hashCode()`
`String`
`toString()`
`static IdPAttributeValue`
`valueOf(String value)`
Returns an `EmptyAttributeValue` or `StringAttributeValue` as appropriate.

### 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

### value

@Nonnull @NotEmpty private final String value
The attribute value.

## Constructor Details

### StringAttributeValue

public StringAttributeValue(@Nonnull @NotEmpty @ParameterName(name="attributeValue") String attributeValue)
Constructor.

Parameters:
  `attributeValue` - the attribute value

## Method Details

### getNativeValue

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

Specified by:
  `getNativeValue` in interface `IdPAttributeValue`
Returns:
  the attribute value in native format.

### getValue

@Nonnull @NotEmpty public final String getValue()
Return the value.

Returns:
  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`
Returns:
  a displayable value

### equals

public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### valueOf

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

Parameters:
  `value` - to inspect
Returns:
  `EmptyAttributeValue` or `StringAttributeValue`