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.ContentgetContent()ContentgetExpectedContent()ContentKeygetKey()inthashCode()Computes a hash code from attributes:key,content,expectedContent.StringtoString()Prints the immutable valuePutwith attribute values.ImmutablePutwithContent(Content value)Copy the current immutable object by setting a value for thecontentattribute.ImmutablePutwithExpectedContent(Content value)Copy the current immutable object by setting a value for theexpectedContentattribute.ImmutablePutwithKey(ContentKey value)Copy the current immutable object by setting a value for thekeyattribute.
-
-
-
Method Detail
-
getKey
public ContentKey getKey()
-
getContent
public Content getContent()
- Specified by:
getContentin interfaceOperation.Put- Returns:
- The value of the
contentattribute
-
getExpectedContent
@Nullable public Content getExpectedContent()
- Specified by:
getExpectedContentin interfaceOperation.Put- Returns:
- The value of the
expectedContentattribute
-
withKey
public final ImmutablePut withKey(ContentKey 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
-
withContent
public final ImmutablePut withContent(Content value)
Copy the current immutable object by setting a value for thecontentattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for content- Returns:
- A modified copy of the
thisobject
-
withExpectedContent
public final ImmutablePut withExpectedContent(@Nullable Content value)
Copy the current immutable object by setting a value for theexpectedContentattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for expectedContent (can benull)- 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()
Computes a hash code from attributes:key,content,expectedContent.
-
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.ContentKey) // requiredkey.content(org.projectnessie.model.Content) // requiredcontent.expectedContent(org.projectnessie.model.Content | null) // nullableexpectedContent.build();- Returns:
- A new ImmutablePut builder
-
-