Package org.projectnessie.model
Class ImmutableDiffEntry
- java.lang.Object
-
- org.projectnessie.model.ImmutableDiffEntry
-
- All Implemented Interfaces:
DiffResponse.DiffEntry
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableDiffEntry extends Object implements DiffResponse.DiffEntry
Immutable implementation ofDiffResponse.DiffEntry.Use the builder to create immutable instances:
ImmutableDiffEntry.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableDiffEntry.BuilderBuilds instances of typeImmutableDiffEntry.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableDiffEntry.Builderbuilder()Creates a builder forImmutableDiffEntry.static ImmutableDiffEntrycopyOf(DiffResponse.DiffEntry instance)Creates an immutable copy of aDiffResponse.DiffEntryvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableDiffEntrythat have equal attribute values.ContentgetFrom()ContentKeygetKey()ContentgetTo()inthashCode()Computes a hash code from attributes:key,from,to.StringtoString()Prints the immutable valueDiffEntrywith attribute values.ImmutableDiffEntrywithFrom(Content value)Copy the current immutable object by setting a value for thefromattribute.ImmutableDiffEntrywithKey(ContentKey value)Copy the current immutable object by setting a value for thekeyattribute.ImmutableDiffEntrywithTo(Content value)Copy the current immutable object by setting a value for thetoattribute.
-
-
-
Method Detail
-
getKey
public ContentKey getKey()
- Specified by:
getKeyin interfaceDiffResponse.DiffEntry- Returns:
- The value of the
keyattribute
-
getFrom
@Nullable public Content getFrom()
- Specified by:
getFromin interfaceDiffResponse.DiffEntry- Returns:
- The value of the
fromattribute
-
getTo
@Nullable public Content getTo()
- Specified by:
getToin interfaceDiffResponse.DiffEntry- Returns:
- The value of the
toattribute
-
withKey
public final ImmutableDiffEntry 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
-
withFrom
public final ImmutableDiffEntry withFrom(@Nullable Content value)
Copy the current immutable object by setting a value for thefromattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for from (can benull)- Returns:
- A modified copy of the
thisobject
-
withTo
public final ImmutableDiffEntry withTo(@Nullable Content value)
Copy the current immutable object by setting a value for thetoattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for to (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableDiffEntrythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:key,from,to.
-
toString
public String toString()
Prints the immutable valueDiffEntrywith attribute values.
-
copyOf
public static ImmutableDiffEntry copyOf(DiffResponse.DiffEntry instance)
Creates an immutable copy of aDiffResponse.DiffEntryvalue. 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 DiffEntry instance
-
builder
public static ImmutableDiffEntry.Builder builder()
Creates a builder forImmutableDiffEntry.ImmutableDiffEntry.builder() .key(org.projectnessie.model.ContentKey) // requiredkey.from(org.projectnessie.model.Content | null) // nullablefrom.to(org.projectnessie.model.Content | null) // nullableto.build();- Returns:
- A new ImmutableDiffEntry builder
-
-