Package net.shibboleth.idp.attribute
Class ByteAttributeValue
- java.lang.Object
-
- net.shibboleth.idp.attribute.ByteAttributeValue
-
- All Implemented Interfaces:
Comparable<IdPAttributeValue>
,IdPAttributeValue
public final class ByteAttributeValue extends Object implements IdPAttributeValue
Abyte[]
value for anIdPAttribute
.
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
value
Value of the attribute.
-
Constructor Summary
Constructors Constructor Description ByteAttributeValue(byte[] attributeValue)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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.byte[]
getValue()
Return the value.int
hashCode()
String
toBase64()
Gets this value as a Base64-encoded string.String
toHex()
Get this value as a hex-encoded string.String
toString()
static IdPAttributeValue
valueOf(byte[] value)
Returns anEmptyAttributeValue
orByteAttributeValue
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
-
-
-
-
Constructor Detail
-
ByteAttributeValue
public ByteAttributeValue(@Nonnull @ParameterName(name="attributeValue") byte[] attributeValue)
Constructor.- Parameters:
attributeValue
- value of the attribute
-
-
Method Detail
-
getValue
public byte[] getValue()
Return the value.- Returns:
- the value
-
getNativeValue
public Object getNativeValue()
Get the native representation of the value of this attribute.- Specified by:
getNativeValue
in interfaceIdPAttributeValue
- Returns:
- the attribute value in native format.
-
getDisplayValue
@Nonnull @NotEmpty public String getDisplayValue()
Get a displayable form of the value for user interfaces and similar purposes.- Specified by:
getDisplayValue
in interfaceIdPAttributeValue
- Returns:
- a displayable value
-
toHex
@Nonnull public String toHex()
Get this value as a hex-encoded string.- Returns:
- a hex-encoded string
-
toBase64
@Nonnull public String toBase64() throws EncodingException
Gets this value as a Base64-encoded string.- Returns:
- a Base64-encoded string
- Throws:
EncodingException
- on failure to base64 encode byte value
-
valueOf
@Nonnull public static IdPAttributeValue valueOf(@Nullable byte[] value)
Returns anEmptyAttributeValue
orByteAttributeValue
as appropriate. This method should be preferred over the constructor when the value may be null or empty.- Parameters:
value
- to inspect- Returns:
EmptyAttributeValue
orByteAttributeValue
-
-