Class ImmutableMetadata

  • All Implemented Interfaces:
    Metadata, Serializable

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

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

    See Also:
    Serialized Form
    • Method Detail

      • getDescription

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

        public String getLabel()
        Specified by:
        getLabel in interface Metadata
        Returns:
        The value of the label attribute
      • getCreated

        public Date getCreated()
        Specified by:
        getCreated in interface Metadata
        Returns:
        The value of the created attribute
      • getLastSaved

        public Date getLastSaved()
        Specified by:
        getLastSaved in interface Metadata
        Returns:
        The value of the lastSaved attribute
      • getValid

        public Boolean getValid()
        Specified by:
        getValid in interface Metadata
        Returns:
        The value of the valid attribute
      • withDescription

        public final ImmutableMetadata 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
      • withLabel

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

        public final ImmutableMetadata withCreated​(Date value)
        Copy the current immutable object by setting a value for the created attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for created (can be null)
        Returns:
        A modified copy of the this object
      • withLastSaved

        public final ImmutableMetadata withLastSaved​(Date value)
        Copy the current immutable object by setting a value for the lastSaved attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for lastSaved (can be null)
        Returns:
        A modified copy of the this object
      • withValid

        public final ImmutableMetadata withValid​(Boolean value)
        Copy the current immutable object by setting a value for the valid attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for valid (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 ImmutableMetadata 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: description, label, created, lastSaved, valid.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

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

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

        public static ImmutableMetadata.Builder builder()
        Creates a builder for ImmutableMetadata.
         ImmutableMetadata.builder()
            .description(String | null) // nullable description
            .label(String) // required label
            .created(Date | null) // nullable created
            .lastSaved(Date | null) // nullable lastSaved
            .valid(Boolean | null) // nullable valid
            .build();
         
        Returns:
        A new ImmutableMetadata builder