Class ImmutableAuthenticationSubject

  • All Implemented Interfaces:
    AuthenticationSubject

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    public final class ImmutableAuthenticationSubject
    extends Object
    implements AuthenticationSubject
    Immutable implementation of AuthenticationSubject.

    Use the builder to create immutable instances: ImmutableAuthenticationSubject.builder(). Use the static factory method to create immutable instances: ImmutableAuthenticationSubject.of().

    • Method Detail

      • withToken

        public final ImmutableAuthenticationSubject withToken​(@Nullable
                                                              String value)
        Copy the current immutable object by setting a value for the token attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for token (can be null)
        Returns:
        A modified copy of the this object
      • withRoleName

        public final ImmutableAuthenticationSubject withRoleName​(String value)
        Copy the current immutable object by setting a value for the roleName attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for roleName
        Returns:
        A modified copy of the this object
      • withIsFromExternalAuth

        public final ImmutableAuthenticationSubject withIsFromExternalAuth​(boolean value)
        Copy the current immutable object by setting a value for the isFromExternalAuth attribute. A value equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for isFromExternalAuth
        Returns:
        A modified copy of the this object
      • withCustomProperties

        public final ImmutableAuthenticationSubject withCustomProperties​(Map<String,​String> value)
        Copy the current immutable object by setting a value for the customProperties attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for customProperties
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableAuthenticationSubject that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: token, roleName, isFromExternalAuth, customProperties.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value AuthenticationSubject with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • of

        public static ImmutableAuthenticationSubject of​(@Nullable
                                                        String token,
                                                        String roleName,
                                                        boolean isFromExternalAuth,
                                                        Map<String,​String> customProperties)
        Construct a new immutable AuthenticationSubject instance.
        Parameters:
        token - The value for the token attribute
        roleName - The value for the roleName attribute
        isFromExternalAuth - The value for the isFromExternalAuth attribute
        customProperties - The value for the customProperties attribute
        Returns:
        An immutable AuthenticationSubject instance
      • copyOf

        public static ImmutableAuthenticationSubject copyOf​(AuthenticationSubject instance)
        Creates an immutable copy of a AuthenticationSubject value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable AuthenticationSubject instance