Package org.projectnessie.model
Class ImmutableContentsKey
- java.lang.Object
-
- org.projectnessie.model.ContentsKey
-
- org.projectnessie.model.ImmutableContentsKey
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableContentsKey extends ContentsKey
Immutable implementation ofContentsKey.Use the builder to create immutable instances:
ImmutableContentsKey.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableContentsKey.BuilderBuilds instances of typeImmutableContentsKey.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableContentsKey.Builderbuilder()Creates a builder forImmutableContentsKey.static ImmutableContentsKeycopyOf(ContentsKey instance)Creates an immutable copy of aContentsKeyvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableContentsKeythat have equal attribute values.List<String>getElements()inthashCode()Returns a lazily computed hash code from attributes:elements.ImmutableContentsKeywithElements(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofelements.ImmutableContentsKeywithElements(String... elements)Copy the current immutable object with elements that replace the content ofelements.-
Methods inherited from class org.projectnessie.model.ContentsKey
fromPathString, getName, getNamespace, of, of, of, toPathString, toString, validate
-
-
-
-
Method Detail
-
getElements
public List<String> getElements()
- Specified by:
getElementsin classContentsKey- Returns:
- The value of the
elementsattribute
-
withElements
public final ImmutableContentsKey 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 ImmutableContentsKey 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 ofImmutableContentsKeythat have equal attribute values.
-
hashCode
public int hashCode()
Returns a lazily computed hash code from attributes:elements.
-
copyOf
public static ImmutableContentsKey copyOf(ContentsKey instance)
Creates an immutable copy of aContentsKeyvalue. 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 ContentsKey instance
-
builder
public static ImmutableContentsKey.Builder builder()
Creates a builder forImmutableContentsKey.ImmutableContentsKey.builder() .addElements|addAllElements(String) //elementselements .build();- Returns:
- A new ImmutableContentsKey builder
-
-