Class ImmutableHiveTable

    • 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.

        Overrides:
        getId in class Contents
      • getTableDefinition

        @Size(min=1)
        public @javax.validation.constraints.Size(min=1) byte[] getTableDefinition()
        Specified by:
        getTableDefinition in class HiveTable
        Returns:
        A cloned tableDefinition array
      • getPartitions

        public List<byte[]> getPartitions()
        Specified by:
        getPartitions in class HiveTable
        Returns:
        The value of the partitions attribute
      • withId

        public final ImmutableHiveTable withId​(String value)
        Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for id
        Returns:
        A modified copy of the this object
      • 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 of tableDefinition. The array is cloned before being saved as attribute values.
        Parameters:
        elements - The non-null elements for tableDefinition
        Returns:
        A modified copy of this object
      • withPartitions

        public final ImmutableHiveTable withPartitions​(byte[]... elements)
        Copy the current immutable object with elements that replace the content of partitions.
        Parameters:
        elements - The elements to set
        Returns:
        A modified copy of this object
      • withPartitions

        public final ImmutableHiveTable withPartitions​(Iterable<? extends byte[]> elements)
        Copy the current immutable object with elements that replace the content of partitions. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        elements - An iterable of partitions elements to set
        Returns:
        A modified copy of this object
      • hashCode

        public int hashCode()
        Returns the precomputed-on-construction hash code from the supertype implementation of super.hashCode().
        Overrides:
        hashCode in class HiveTable
        Returns:
        The hashCode value
      • toString

        public String toString()
        Prints the immutable value HiveTable with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static ImmutableHiveTable copyOf​(HiveTable instance)
        Creates an immutable copy of a HiveTable value. 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 for ImmutableHiveTable.
         ImmutableHiveTable.builder()
            .id(String) // optional id
            .tableDefinition(@javax.validation.constraints.Size(min=1) byte) // required tableDefinition
            .addPartitions|addAllPartitions(byte[]) // partitions elements
            .build();
         
        Returns:
        A new ImmutableHiveTable builder