Class ClickHouseArrayValue<T>

    • Constructor Detail

      • ClickHouseArrayValue

        protected ClickHouseArrayValue​(T[] value)
    • Method Detail

      • ofEmpty

        public static <T> ClickHouseArrayValue<T> ofEmpty()
        Creates an empty array.
        Type Parameters:
        T - type of the array
        Returns:
        empty array
      • of

        public static <T> ClickHouseArrayValue<T> of​(T[] value)
        Wrap the given value.
        Type Parameters:
        T - type of element
        Parameters:
        value - value
        Returns:
        object representing the value
      • of

        public static <T> ClickHouseArrayValue<T> of​(ClickHouseValue ref,
                                                     T[] value)
        Update value of the given object or create a new instance if ref is null.
        Type Parameters:
        T - type of element
        Parameters:
        ref - object to update, could be null
        value - value
        Returns:
        same object as ref or a new instance if it's null
      • asArray

        public Object[] asArray()
        Description copied from interface: ClickHouseValue
        Gets value as an object array.
        Returns:
        non-null object array
      • asArray

        public <E> E[] asArray​(Class<E> clazz)
        Description copied from interface: ClickHouseValue
        Gets value as an array.
        Type Parameters:
        E - type of the element
        Parameters:
        clazz - class of the element
        Returns:
        non-null array
      • asMap

        public <K,​V> Map<K,​V> asMap​(Class<K> keyClass,
                                                Class<V> valueClass)
        Description copied from interface: ClickHouseValue
        Gets value as a map.
        Type Parameters:
        K - type of key
        V - type of value
        Parameters:
        keyClass - non-null class of key
        valueClass - non-null class of value
        Returns:
        non-null map value
      • asString

        public String asString​(int length,
                               Charset charset)
        Description copied from interface: ClickHouseValue
        Gets value as fixed length(in bytes) string.
        Specified by:
        asString in interface ClickHouseValue
        Overrides:
        asString in class ClickHouseObjectValue<T[]>
        Parameters:
        length - byte length of the string, 0 or negative number means unbounded
        charset - charset, null is same as default(UTF-8)
        Returns:
        string value, could be null
      • copy

        public ClickHouseArrayValue<T> copy​(boolean deep)
        Description copied from interface: ClickHouseValue
        Gets a copy of this value object.
        Parameters:
        deep - true to create a deep copy; false for a shallow copy
        Returns:
        copy of this value object
      • isNullable

        public boolean isNullable()
        Description copied from interface: ClickHouseValue
        Checks whether the value is nullable. This always returns false for nested value type.
        Returns:
        true if the value is nullable; false otherwise
      • isNullOrEmpty

        public boolean isNullOrEmpty()
        Description copied from interface: ClickHouseValue
        Checks if the value is null, or empty for non-null types like Array, Tuple and Map.

        Please pay attention that only nullability will be considered for String, meaning this method will return false for an empty string. This is because String is treated as value-based type instead of a container like Array.

        Specified by:
        isNullOrEmpty in interface ClickHouseValue
        Overrides:
        isNullOrEmpty in class ClickHouseObjectValue<T[]>
        Returns:
        true if the value is null or empty; false otherwise
      • resetToDefault

        public ClickHouseArrayValue<T> resetToDefault()
        Description copied from interface: ClickHouseValue
        Resets to default value of corresponding data type.
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(boolean[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(char[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(byte value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(byte[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(short value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(short[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(int value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(int[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(long value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(long[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(float value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(float[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(double value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(double[] value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object
      • update

        public ClickHouseArrayValue<T> update​(Map<?,​?> value)
        Description copied from interface: ClickHouseValue
        Updates value.
        Parameters:
        value - value to update
        Returns:
        this object