Class ImmutableError

  • All Implemented Interfaces:
    Error, Serializable

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

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

    See Also:
    Serialized Form
    • Method Detail

      • getId

        public String getId()
        Specified by:
        getId in interface Error
        Returns:
        The value of the id attribute
      • getCode

        public String getCode()
        Specified by:
        getCode in interface Error
        Returns:
        The value of the code attribute
      • getDescription

        public String getDescription()
        Specified by:
        getDescription in interface Error
        Returns:
        The value of the description attribute
      • withId

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

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

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

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableError 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: id, code, description.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

        public static ImmutableError of​(String id,
                                        String code,
                                        String description)
        Construct a new immutable Error instance.
        Parameters:
        id - The value for the id attribute
        code - The value for the code attribute
        description - The value for the description attribute
        Returns:
        An immutable Error instance
      • copyOf

        public static ImmutableError copyOf​(Error instance)
        Creates an immutable copy of a Error 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 Error instance
      • builder

        public static ImmutableError.Builder builder()
        Creates a builder for ImmutableError.
         ImmutableError.builder()
            .id(String) // required id
            .code(String | null) // nullable code
            .description(String | null) // nullable description
            .build();
         
        Returns:
        A new ImmutableError builder