Package org.projectnessie.model
Class ImmutableNamespace
- java.lang.Object
-
- org.projectnessie.model.Content
-
- org.projectnessie.model.Namespace
-
- org.projectnessie.model.ImmutableNamespace
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableNamespace extends Namespace
Immutable implementation ofNamespace.Use the builder to create immutable instances:
ImmutableNamespace.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableNamespace.BuilderBuilds instances of typeImmutableNamespace.-
Nested classes/interfaces inherited from class org.projectnessie.model.Content
Content.Type
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableNamespace.Builderbuilder()Creates a builder forImmutableNamespace.static ImmutableNamespacecopyOf(Namespace instance)Creates an immutable copy of aNamespacevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableNamespacethat have equal attribute values.List<String>getElements()StringgetId()Unique id for this object.inthashCode()Computes a hash code from attributes:name,id,elements.Stringname()ImmutableNamespacewithElements(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofelements.ImmutableNamespacewithElements(String... elements)Copy the current immutable object with elements that replace the content ofelements.-
Methods inherited from class org.projectnessie.model.Namespace
fromPathString, getType, isEmpty, of, of, parse, toPathString, toString
-
-
-
-
Method Detail
-
name
public String name()
-
getId
public String getId()
Description copied from class:ContentUnique id for this object.This id is unique for the entire lifetime of this Content object and persists across renames. Two content objects with the same key will have different id.
-
getElements
public List<String> getElements()
- Specified by:
getElementsin classNamespace- Returns:
- The value of the
elementsattribute
-
withElements
public final ImmutableNamespace 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 ImmutableNamespace 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 ofImmutableNamespacethat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:name,id,elements.
-
copyOf
public static ImmutableNamespace copyOf(Namespace instance)
Creates an immutable copy of aNamespacevalue. 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 Namespace instance
-
builder
public static ImmutableNamespace.Builder builder()
Creates a builder forImmutableNamespace.ImmutableNamespace.builder() .addElements|addAllElements(String) //elementselements .build();- Returns:
- A new ImmutableNamespace builder
-
-