Package org.projectnessie.model
Class ImmutablePut
- java.lang.Object
-
- org.projectnessie.model.ImmutablePut
-
- All Implemented Interfaces:
Operation,Operation.Put
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutablePut extends Object implements Operation.Put
Immutable implementation ofOperation.Put.Use the builder to create immutable instances:
ImmutablePut.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutablePut.BuilderBuilds instances of typeImmutablePut.-
Nested classes/interfaces inherited from interface org.projectnessie.model.Operation
Operation.Delete, Operation.Put, Operation.Unchanged
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutablePut.Builderbuilder()Creates a builder forImmutablePut.static ImmutablePutcopyOf(Operation.Put instance)Creates an immutable copy of aOperation.Putvalue.booleanequals(Object another)This instance is equal to all instances ofImmutablePutthat have equal attribute values.ContentsgetContents()ContentsKeygetKey()inthashCode()Returns a precomputed-on-construction hash code from attributes:key,contents.StringtoString()Prints the immutable valuePutwith attribute values.ImmutablePutwithContents(Contents value)Copy the current immutable object by setting a value for thecontentsattribute.ImmutablePutwithKey(ContentsKey value)Copy the current immutable object by setting a value for thekeyattribute.
-
-
-
Method Detail
-
getKey
public ContentsKey getKey()
-
getContents
public Contents getContents()
- Specified by:
getContentsin interfaceOperation.Put- Returns:
- The value of the
contentsattribute
-
withKey
public final ImmutablePut withKey(ContentsKey value)
Copy the current immutable object by setting a value for thekeyattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for key- Returns:
- A modified copy of the
thisobject
-
withContents
public final ImmutablePut withContents(Contents value)
Copy the current immutable object by setting a value for thecontentsattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for contents- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutablePutthat have equal attribute values.
-
hashCode
public int hashCode()
Returns a precomputed-on-construction hash code from attributes:key,contents.
-
toString
public String toString()
Prints the immutable valuePutwith attribute values.
-
copyOf
public static ImmutablePut copyOf(Operation.Put instance)
Creates an immutable copy of aOperation.Putvalue. 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 Put instance
-
builder
public static ImmutablePut.Builder builder()
Creates a builder forImmutablePut.ImmutablePut.builder() .key(org.projectnessie.model.ContentsKey) // requiredkey.contents(org.projectnessie.model.Contents) // requiredcontents.build();- Returns:
- A new ImmutablePut builder
-
-