Package org.projectnessie.model
Class ImmutableHiveDatabase
- java.lang.Object
-
- org.projectnessie.model.Contents
-
- org.projectnessie.model.HiveDatabase
-
- org.projectnessie.model.ImmutableHiveDatabase
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableHiveDatabase extends HiveDatabase
Immutable implementation ofHiveDatabase.Use the builder to create immutable instances:
ImmutableHiveDatabase.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableHiveDatabase.BuilderBuilds instances of typeImmutableHiveDatabase.-
Nested classes/interfaces inherited from class org.projectnessie.model.Contents
Contents.Type
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableHiveDatabase.Builderbuilder()Creates a builder forImmutableHiveDatabase.static ImmutableHiveDatabasecopyOf(HiveDatabase instance)Creates an immutable copy of aHiveDatabasevalue.booleanequals(Object another)This instance is equal to all instances ofImmutableHiveDatabasethat have equal attribute values.byte[]getDatabaseDefinition()StringgetId()Unique id for this object.inthashCode()Returns a precomputed-on-construction hash code from attributes:id,databaseDefinition.StringtoString()Prints the immutable valueHiveDatabasewith attribute values.ImmutableHiveDatabasewithDatabaseDefinition(byte... elements)Copy the current immutable object with elements that replace the content ofdatabaseDefinition.ImmutableHiveDatabasewithId(String value)Copy the current immutable object by setting a value for theidattribute.
-
-
-
Method Detail
-
getId
public String getId()
Unique id for this object.This id is unique for the entire lifetime of this Contents object and persists across renames. Two contents with the same key will have different id.
-
getDatabaseDefinition
public byte[] getDatabaseDefinition()
- Specified by:
getDatabaseDefinitionin classHiveDatabase- Returns:
- A cloned
databaseDefinitionarray
-
withId
public final ImmutableHiveDatabase withId(String value)
Copy the current immutable object by setting a value for theidattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for id- Returns:
- A modified copy of the
thisobject
-
withDatabaseDefinition
public final ImmutableHiveDatabase withDatabaseDefinition(byte... elements)
Copy the current immutable object with elements that replace the content ofdatabaseDefinition. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for databaseDefinition- Returns:
- A modified copy of
thisobject
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableHiveDatabasethat have equal attribute values.
-
hashCode
public int hashCode()
Returns a precomputed-on-construction hash code from attributes:id,databaseDefinition.
-
toString
public String toString()
Prints the immutable valueHiveDatabasewith attribute values.
-
copyOf
public static ImmutableHiveDatabase copyOf(HiveDatabase instance)
Creates an immutable copy of aHiveDatabasevalue. 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 HiveDatabase instance
-
builder
public static ImmutableHiveDatabase.Builder builder()
Creates a builder forImmutableHiveDatabase.ImmutableHiveDatabase.builder() .id(String) // optionalid.databaseDefinition(byte) // requireddatabaseDefinition.build();- Returns:
- A new ImmutableHiveDatabase builder
-
-