Package org.projectnessie.model
Class ImmutableEntry
- java.lang.Object
-
- org.projectnessie.model.ImmutableEntry
-
- All Implemented Interfaces:
EntriesResponse.Entry
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableEntry extends Object implements EntriesResponse.Entry
Immutable implementation ofEntriesResponse.Entry.Use the builder to create immutable instances:
ImmutableEntry.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableEntry.BuilderBuilds instances of typeImmutableEntry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableEntry.Builderbuilder()Creates a builder forImmutableEntry.static ImmutableEntrycopyOf(EntriesResponse.Entry instance)Creates an immutable copy of aEntriesResponse.Entryvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableEntrythat have equal attribute values.ContentKeygetName()Content.TypegetType()inthashCode()Computes a hash code from attributes:type,name.StringtoString()Prints the immutable valueEntrywith attribute values.ImmutableEntrywithName(ContentKey value)Copy the current immutable object by setting a value for thenameattribute.ImmutableEntrywithType(Content.Type value)Copy the current immutable object by setting a value for thetypeattribute.
-
-
-
Method Detail
-
getType
public Content.Type getType()
- Specified by:
getTypein interfaceEntriesResponse.Entry- Returns:
- The value of the
typeattribute
-
getName
public ContentKey getName()
- Specified by:
getNamein interfaceEntriesResponse.Entry- Returns:
- The value of the
nameattribute
-
withType
public final ImmutableEntry withType(Content.Type value)
Copy the current immutable object by setting a value for thetypeattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for type- Returns:
- A modified copy of the
thisobject
-
withName
public final ImmutableEntry withName(ContentKey value)
Copy the current immutable object by setting a value for thenameattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableEntrythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:type,name.
-
toString
public String toString()
Prints the immutable valueEntrywith attribute values.
-
copyOf
public static ImmutableEntry copyOf(EntriesResponse.Entry instance)
Creates an immutable copy of aEntriesResponse.Entryvalue. 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 Entry instance
-
builder
public static ImmutableEntry.Builder builder()
Creates a builder forImmutableEntry.ImmutableEntry.builder() .type(org.projectnessie.model.Content.Type) // requiredtype.name(org.projectnessie.model.ContentKey) // requiredname.build();- Returns:
- A new ImmutableEntry builder
-
-