Package io.dialob.api.rest
Class ImmutableMetadata
- java.lang.Object
-
- io.dialob.api.rest.ImmutableMetadata
-
- All Implemented Interfaces:
Metadata,Serializable
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable public final class ImmutableMetadata extends Object implements Metadata
Immutable implementation ofMetadata.Use the builder to create immutable instances:
ImmutableMetadata.builder().- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableMetadata.BuilderBuilds instances of typeImmutableMetadata.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableMetadata.Builderbuilder()Creates a builder forImmutableMetadata.static ImmutableMetadatacopyOf(Metadata instance)Creates an immutable copy of aMetadatavalue.booleanequals(Object another)This instance is equal to all instances ofImmutableMetadatathat have equal attribute values.DategetCreated()StringgetDescription()StringgetLabel()DategetLastSaved()BooleangetValid()inthashCode()Computes a hash code from attributes:description,label,created,lastSaved,valid.StringtoString()Prints the immutable valueMetadatawith attribute values.ImmutableMetadatawithCreated(Date value)Copy the current immutable object by setting a value for thecreatedattribute.ImmutableMetadatawithDescription(String value)Copy the current immutable object by setting a value for thedescriptionattribute.ImmutableMetadatawithLabel(String value)Copy the current immutable object by setting a value for thelabelattribute.ImmutableMetadatawithLastSaved(Date value)Copy the current immutable object by setting a value for thelastSavedattribute.ImmutableMetadatawithValid(Boolean value)Copy the current immutable object by setting a value for thevalidattribute.
-
-
-
Method Detail
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceMetadata- Returns:
- The value of the
descriptionattribute
-
getLabel
public String getLabel()
-
getCreated
public Date getCreated()
- Specified by:
getCreatedin interfaceMetadata- Returns:
- The value of the
createdattribute
-
getLastSaved
public Date getLastSaved()
- Specified by:
getLastSavedin interfaceMetadata- Returns:
- The value of the
lastSavedattribute
-
getValid
public Boolean getValid()
-
withDescription
public final ImmutableMetadata withDescription(String value)
Copy the current immutable object by setting a value for thedescriptionattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for description (can benull)- Returns:
- A modified copy of the
thisobject
-
withLabel
public final ImmutableMetadata withLabel(String value)
Copy the current immutable object by setting a value for thelabelattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for label- Returns:
- A modified copy of the
thisobject
-
withCreated
public final ImmutableMetadata withCreated(Date value)
Copy the current immutable object by setting a value for thecreatedattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for created (can benull)- Returns:
- A modified copy of the
thisobject
-
withLastSaved
public final ImmutableMetadata withLastSaved(Date value)
Copy the current immutable object by setting a value for thelastSavedattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for lastSaved (can benull)- Returns:
- A modified copy of the
thisobject
-
withValid
public final ImmutableMetadata withValid(Boolean value)
Copy the current immutable object by setting a value for thevalidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for valid (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableMetadatathat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:description,label,created,lastSaved,valid.
-
toString
public String toString()
Prints the immutable valueMetadatawith attribute values.
-
copyOf
public static ImmutableMetadata copyOf(Metadata instance)
Creates an immutable copy of aMetadatavalue. 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 forImmutableMetadata.ImmutableMetadata.builder() .description(String | null) // nullabledescription.label(String) // requiredlabel.created(Date | null) // nullablecreated.lastSaved(Date | null) // nullablelastSaved.valid(Boolean | null) // nullablevalid.build();- Returns:
- A new ImmutableMetadata builder
-
-