Package org.projectnessie.model
Class ImmutableHiveTable
- java.lang.Object
-
- org.projectnessie.model.Contents
-
- org.projectnessie.model.HiveTable
-
- org.projectnessie.model.ImmutableHiveTable
-
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableHiveTable extends HiveTable
Immutable implementation ofHiveTable.Use the builder to create immutable instances:
ImmutableHiveTable.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableHiveTable.BuilderBuilds instances of typeImmutableHiveTable.-
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 ImmutableHiveTable.Builderbuilder()Creates a builder forImmutableHiveTable.static ImmutableHiveTablecopyOf(HiveTable instance)Creates an immutable copy of aHiveTablevalue.StringgetId()Unique id for this object.List<byte[]>getPartitions()@javax.validation.constraints.Size(min=1) byte[]getTableDefinition()inthashCode()Returns the precomputed-on-construction hash code from the supertype implementation ofsuper.hashCode().StringtoString()Prints the immutable valueHiveTablewith attribute values.ImmutableHiveTablewithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableHiveTablewithPartitions(byte[]... elements)Copy the current immutable object with elements that replace the content ofpartitions.ImmutableHiveTablewithPartitions(Iterable<? extends byte[]> elements)Copy the current immutable object with elements that replace the content ofpartitions.ImmutableHiveTablewithTableDefinition(@javax.validation.constraints.Size(min=1) byte... elements)Copy the current immutable object with elements that replace the content oftableDefinition.
-
-
-
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.
-
getTableDefinition
@Size(min=1) public @javax.validation.constraints.Size(min=1) byte[] getTableDefinition()
- Specified by:
getTableDefinitionin classHiveTable- Returns:
- A cloned
tableDefinitionarray
-
getPartitions
public List<byte[]> getPartitions()
- Specified by:
getPartitionsin classHiveTable- Returns:
- The value of the
partitionsattribute
-
withId
public final ImmutableHiveTable 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
-
withTableDefinition
public final ImmutableHiveTable withTableDefinition(@Size(min=1) @javax.validation.constraints.Size(min=1) byte... elements)
Copy the current immutable object with elements that replace the content oftableDefinition. The array is cloned before being saved as attribute values.- Parameters:
elements- The non-null elements for tableDefinition- Returns:
- A modified copy of
thisobject
-
withPartitions
public final ImmutableHiveTable withPartitions(byte[]... elements)
Copy the current immutable object with elements that replace the content ofpartitions.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withPartitions
public final ImmutableHiveTable withPartitions(Iterable<? extends byte[]> elements)
Copy the current immutable object with elements that replace the content ofpartitions. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of partitions elements to set- Returns:
- A modified copy of
thisobject
-
hashCode
public int hashCode()
Returns the precomputed-on-construction hash code from the supertype implementation ofsuper.hashCode().
-
toString
public String toString()
Prints the immutable valueHiveTablewith attribute values.
-
copyOf
public static ImmutableHiveTable copyOf(HiveTable instance)
Creates an immutable copy of aHiveTablevalue. 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 HiveTable instance
-
builder
public static ImmutableHiveTable.Builder builder()
Creates a builder forImmutableHiveTable.ImmutableHiveTable.builder() .id(String) // optionalid.tableDefinition(@javax.validation.constraints.Size(min=1) byte) // requiredtableDefinition.addPartitions|addAllPartitions(byte[]) //partitionselements .build();- Returns:
- A new ImmutableHiveTable builder
-
-