Interface AttributeValue

All Superinterfaces:
AttributeOrAttributeValue<AttributeValue>
All Known Implementing Classes:
Address, AuthorizationActionAttributes, AuthorizationResourceAttributes, BinaryAttributeValue, ComplexAttributeValue, ContextAttributes, Device, Email, Entitlement, GraphQLAuthorizationActionAttributes, GraphQLAuthorizationResourceAttributes, Group, InstantMessaging, LinkedAccount, ListAttributeValue, MapAttributeValue, Meta, MultiValuedAttributeValue, Name, NullAttributeValue, OAuthAuthorizationActionAttributes, OAuthAuthorizationResourceAttributes, PhoneNumber, Photo, PrimitiveAttributeValue, PrimitiveAttributeValue.StringAttributeValue, Role, ScimAuthorizationActionAttributes, ScimAuthorizationResourceAttributes, SubjectAttributes, X509Certificates

public interface AttributeValue extends AttributeOrAttributeValue<AttributeValue>
Object representing an Attribute value.

Instances of this type are created using factory methods. For example:

AttributeValue<String> name = AttributeValue.of("attr");

See Also:
  • Method Details

    • isEmpty

      boolean isEmpty()
      Returns:
      true if this AttributeValue is semantically empty, ie. has no value.
    • getValueWithAuthorities

      default Object getValueWithAuthorities()
      Returns:
      a representation of the attribute value allowing for multiple nested attributes with the same name and different authorities. See MapAttributeValue.getValueWithAuthorities() for further information.
      Since:
      5.0.0
    • map

      Description copied from interface: AttributeOrAttributeValue
      Apply the provided transformation on each Attribute and AttributeValue in this attribute tree, recursively.
      Specified by:
      map in interface AttributeOrAttributeValue<AttributeValue>
      Parameters:
      parentPath - of the current attribute or value being transformed.
      transform - transformation function.
      Returns:
      the transformed attribute or value
    • of

      static AttributeValue of(@Nullable Object value)
      Attempt to convert the given Object into an AttributeValue.
      Parameters:
      value - to be converted
      Returns:
      a valid AttributeValue if possible.
      Throws:
      IllegalArgumentException - if it is not possible to convert the given value to an AttributeValue.
    • of

      static AttributeValue of(@Nullable Comparable<?> value)
    • of

      static AttributeValue of(Map<?,?> map)
    • of

      static AttributeValue of(List<?> items)
    • ofStringOrArray

      static AttributeValue ofStringOrArray(StringOrArray value)
      Convert the given StringOrArray to an AttributeValue.
      Parameters:
      value - to convert
      Returns:
      the value as an AttributeValue
      Since:
      5.3.0
    • formatAsStringAttributeValue

      static String formatAsStringAttributeValue(Instant instant)
      Formats the provided Instant in ISO-8601 format without any offset (i.e., in Zulu time).
      Parameters:
      instant - instant to be formatted
      Returns:
      the instant in the UTC timezone with format 'YYYY-MM-DDThh:mm:ssZ'
    • formatAsStringAttributeValue

      static String formatAsStringAttributeValue(ZonedDateTime dateTime)
      Formats the provided ZonedDateTime using the ISO-8601 format without any offset.
      Parameters:
      dateTime - dateTime to be formatted
      Returns:
      the dateTime in the appropriate timezone with format 'YYYY-MM-DDThh:mm:ssZ'
    • convertToInstant

      static Instant convertToInstant(String dateString)
      Convert a date String with the default timezoned-format used in SCIM to an Instant.
      Parameters:
      dateString - String in the default timezoned-format used in SCIM.
      Returns:
      Instant