Class ImmutablePolicyLink


  • @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutablePolicyLink
    extends Token.PolicyLink
    Immutable implementation of Token.PolicyLink.

    Use the builder to create immutable instances: ImmutablePolicyLink.builder().

    • Method Summary

      Modifier and Type Method Description
      static ImmutablePolicyLink.Builder builder()
      Creates a builder for ImmutablePolicyLink.
      static ImmutablePolicyLink copyOf​(Token.PolicyLink instance)
      Creates an immutable copy of a Token.PolicyLink value.
      boolean equals​(java.lang.Object another)
      This instance is equal to all instances of ImmutablePolicyLink that have equal attribute values.
      int hashCode()
      Computes a hash code from attributes: id, name.
      java.util.Optional<java.lang.String> id()  
      java.util.Optional<java.lang.String> name()  
      java.lang.String toString()
      Prints the immutable value PolicyLink with attribute values.
      ImmutablePolicyLink withId​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional id attribute.
      ImmutablePolicyLink withId​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the id attribute.
      ImmutablePolicyLink withName​(java.lang.String value)
      Copy the current immutable object by setting a present value for the optional name attribute.
      ImmutablePolicyLink withName​(java.util.Optional<java.lang.String> optional)
      Copy the current immutable object by setting an optional value for the name attribute.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • id

        public java.util.Optional<java.lang.String> id()
        Specified by:
        id in class Token.PolicyLink
        Returns:
        The value of the id attribute
      • name

        public java.util.Optional<java.lang.String> name()
        Specified by:
        name in class Token.PolicyLink
        Returns:
        The value of the name attribute
      • withId

        public final ImmutablePolicyLink withId​(java.lang.String value)
        Copy the current immutable object by setting a present value for the optional id attribute.
        Parameters:
        value - The value for id
        Returns:
        A modified copy of this object
      • withId

        public final ImmutablePolicyLink withId​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the id attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for id
        Returns:
        A modified copy of this object
      • withName

        public final ImmutablePolicyLink withName​(java.lang.String value)
        Copy the current immutable object by setting a present value for the optional name attribute.
        Parameters:
        value - The value for name
        Returns:
        A modified copy of this object
      • withName

        public final ImmutablePolicyLink withName​(java.util.Optional<java.lang.String> optional)
        Copy the current immutable object by setting an optional value for the name attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
        Parameters:
        optional - A value for name
        Returns:
        A modified copy of this object
      • equals

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

        public int hashCode()
        Computes a hash code from attributes: id, name.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutablePolicyLink copyOf​(Token.PolicyLink instance)
        Creates an immutable copy of a Token.PolicyLink 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 PolicyLink instance