ru.yandex.clickhouse.util

## Class ClickHouseValueFormatter

- java.lang.Object
- - ru.yandex.clickhouse.util.ClickHouseValueFormatter

    public final class ClickHouseValueFormatter
    extends Object

### Field Summary

Fields
`static String` `NULL_MARKER`

### Method Summary

All Methods Static Methods Concrete Methods
`static String` `formatBigDecimal(BigDecimal myBigDecimal)`
`static String` `formatBigInteger(BigInteger x)`
`static String` `formatBitmap(ClickHouseBitmap bitmap)`
`static String` `formatBoolean(boolean myBoolean)`
`static String` `formatByte(byte myByte)`
`static String` `formatBytes(byte[] bytes)`
`static String` `formatChar(char myChar)`
`static String` `formatDate(Date date, TimeZone timeZone)`
`static String` `formatDouble(double myDouble)`
`static String` `formatFloat(float myFloat)`
`static String` `formatInstant(Instant x, TimeZone timeZone)`
`static String` `formatInt(int myInt)`
`static String` `formatLocalDate(LocalDate x)`
`static String` `formatLocalDateTime(LocalDateTime x)`
`static String` `formatLocalTime(LocalTime x)` Formats a `LocalTime` as "HH:mm:ss".
`static String` `formatLong(long myLong)`
`static String` `formatMap(Map<?,?> map, TimeZone dateTimeZone, TimeZone dateTimeTimeZone)`
`static String` `formatNull()`
`static String` `formatObject(Object x, TimeZone dateTimeZone, TimeZone dateTimeTimeZone)`
`static String` `formatOffsetDateTime(OffsetDateTime x, TimeZone timeZone)`
`static String` `formatOffsetTime(OffsetTime x)`
`static String` `formatShort(short myShort)`
`static String` `formatString(String myString)`
`static String` `formatTime(Time time, TimeZone timeZone)`
`static String` `formatTimestamp(Timestamp time, TimeZone timeZone)`
`static String` `formatUUID(UUID x)`
`static String` `formatZonedDateTime(ZonedDateTime x, TimeZone timeZone)`
`static boolean` `needsQuoting(Object o)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### NULL_MARKER

    public static final String NULL_MARKER

See Also:
  Constant Field Values

### Method Detail

#### formatBytes

    public static String formatBytes(byte[] bytes)

#### formatInt

    public static String formatInt(int myInt)

#### formatDouble

    public static String formatDouble(double myDouble)

#### formatChar

    public static String formatChar(char myChar)

#### formatLong

    public static String formatLong(long myLong)

#### formatFloat

    public static String formatFloat(float myFloat)

#### formatBigDecimal

    public static String formatBigDecimal(BigDecimal myBigDecimal)

#### formatShort

    public static String formatShort(short myShort)

#### formatString

    public static String formatString(String myString)

#### formatNull

    public static String formatNull()

#### formatByte

    public static String formatByte(byte myByte)

#### formatBoolean

    public static String formatBoolean(boolean myBoolean)

#### formatDate

    public static String formatDate(Date date,
                                    TimeZone timeZone)

#### formatTime

    public static String formatTime(Time time,
                                    TimeZone timeZone)

#### formatTimestamp

    public static String formatTimestamp(Timestamp time,
                                         TimeZone timeZone)

#### formatUUID

    public static String formatUUID(UUID x)

#### formatBigInteger

    public static String formatBigInteger(BigInteger x)

#### formatLocalDate

    public static String formatLocalDate(LocalDate x)

#### formatLocalDateTime

    public static String formatLocalDateTime(LocalDateTime x)

#### formatLocalTime

    public static String formatLocalTime(LocalTime x)

Formats a `LocalTime` as "HH:mm:ss". There isn't any dedicated ClickHouse data type for times, so this is the most straightforward thing to do. It would be wrong for the JDBC driver to construct an artificial `DateTime` representation using a dummy date, e.g. 1970-01-01.

Parameters:
  `x` - a `LocalTime` parameter
Returns:
  `x` formatted as "HH:mm:ss"

#### formatOffsetTime

    public static String formatOffsetTime(OffsetTime x)

#### formatOffsetDateTime

    public static String formatOffsetDateTime(OffsetDateTime x,
                                              TimeZone timeZone)

#### formatZonedDateTime

    public static String formatZonedDateTime(ZonedDateTime x,
                                             TimeZone timeZone)

#### formatInstant

    public static String formatInstant(Instant x,
                                       TimeZone timeZone)

#### formatBitmap

    public static String formatBitmap(ClickHouseBitmap bitmap)

#### formatMap

    public static String formatMap(Map<?,?> map,
                                   TimeZone dateTimeZone,
                                   TimeZone dateTimeTimeZone)

#### formatObject

    public static String formatObject(Object x,
                                      TimeZone dateTimeZone,
                                      TimeZone dateTimeTimeZone)

#### needsQuoting

    public static boolean needsQuoting(Object o)