Interface AttributeTranscoder<T>

    • Method Detail

      • getEncodedType

        @Nonnull
        Class<T> getEncodedType()
        Get the class representing the type of object supported by this transcoder.
        Returns:
        object type supported
      • getEncodedName

        @Nullable
        @NotEmpty
        String getEncodedName​(@Nonnull
                              TranscodingRule rule)
        Get the name of the encoded object that would be created by a given set of instructions.
        Parameters:
        rule - properties governing the encoding process
        Returns:
        a canonical name for objects produced by this transcoder for the given instructions
      • encode

        @Nullable
        T encode​(@Nullable
                 ProfileRequestContext profileRequestContext,
                 @Nonnull
                 IdPAttribute attribute,
                 @Nonnull
                 Class<? extends T> to,
                 @Nonnull
                 TranscodingRule rule)
          throws AttributeEncodingException
        Encode the supplied attribute into a protocol specific representation.
        Parameters:
        profileRequestContext - current profile request context
        attribute - the attribute to encode
        to - specific type of object to encode
        rule - properties governing the encoding process, principally the resulting object's naming
        Returns:
        the Object the attribute was encoded into
        Throws:
        AttributeEncodingException - if unable to successfully encode attribute
      • decode

        @Nullable
        IdPAttribute decode​(@Nullable
                            ProfileRequestContext profileRequestContext,
                            @Nonnull
                            T input,
                            @Nonnull
                            TranscodingRule rule)
                     throws AttributeDecodingException
        Decode the supplied object into a protocol-neutral representation.
        Parameters:
        profileRequestContext - current profile request context
        input - the object to decode
        rule - properties governing the decoding process, principally the resulting attribute's naming
        Returns:
        the attribute the object was decoded into
        Throws:
        AttributeDecodingException - if unable to successfully decode object