Package org.projectnessie.model
Class ImmutableContentKey
- java.lang.Object
-
- org.projectnessie.model.ContentKey
-
- org.projectnessie.model.ImmutableContentKey
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableContentKey extends ContentKey
Immutable implementation ofContentKey.Use the builder to create immutable instances:
ImmutableContentKey.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableContentKey.BuilderBuilds instances of typeImmutableContentKey.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableContentKey.Builderbuilder()Creates a builder forImmutableContentKey.static ImmutableContentKeycopyOf(ContentKey instance)Creates an immutable copy of aContentKeyvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableContentKeythat have equal attribute values.List<String>getElements()inthashCode()Computes a hash code from attributes:elements.ImmutableContentKeywithElements(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofelements.ImmutableContentKeywithElements(String... elements)Copy the current immutable object with elements that replace the content ofelements.-
Methods inherited from class org.projectnessie.model.ContentKey
fromPathString, getName, getNamespace, of, of, of, toPathString, toString, validate
-
-
-
-
Method Detail
-
getElements
public List<String> getElements()
- Specified by:
getElementsin classContentKey- Returns:
- The value of the
elementsattribute
-
withElements
public final ImmutableContentKey withElements(String... elements)
Copy the current immutable object with elements that replace the content ofelements.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withElements
public final ImmutableContentKey withElements(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofelements. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of elements elements to set- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableContentKeythat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:elements.
-
copyOf
public static ImmutableContentKey copyOf(ContentKey instance)
Creates an immutable copy of aContentKeyvalue. 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 ContentKey instance
-
builder
public static ImmutableContentKey.Builder builder()
Creates a builder forImmutableContentKey.ImmutableContentKey.builder() .addElements|addAllElements(String) //elementselements .build();- Returns:
- A new ImmutableContentKey builder
-
-