com.streambase.sb

## Interface Tuple.TupleFormatter

- All Known Implementing Classes:
    Tuple.DefaultTupleFormatter
  Enclosing class:
    Tuple

      public static interface Tuple.TupleFormatter

  This interface is not public API, and should not be implemented by users. Use the default StreamBase implementation via `Tuple.getTupleFormatter()` or customize your formatter by subclassing `Tuple.DefaultTupleFormatter` instead.

  Used to format tuple fields, by converting a StreamBase field's value to a string. TupleFormatters must handle the case for when the given value is null, but should never return null.

  See Also:
    `Tuple.getFieldAsString(com.streambase.sb.Schema.Field, com.streambase.sb.Tuple.TupleFormatter)`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `CharSequence` | `formatBlob(ByteArrayView blob)` Return a string representation of the given StreamBase blob value
    `CharSequence` | `formatBool(Boolean b)` Return a string representation of the given StreamBase boolean value
    `CharSequence` | `formatDouble(Double d)` Return a string representation of the given StreamBase double value
    `CharSequence` | `formatFunction(Function f)` Return a string representation of the given StreamBase function
    `CharSequence` | `formatInt(Integer i)` Return a string representation of the given StreamBase integer value
    `CharSequence` | `formatList(CompleteDataType elementType, List<?> l)` Return a string representation of the given StreamBase list
    `CharSequence` | `formatLong(Long l)` Return a string representation of the given StreamBase long value
    `CharSequence` | `formatString(String s)` Return a string representation of the given StreamBase string value
    `CharSequence` | `formatTimestamp(Timestamp t)` Return a string representation of the given StreamBase timestamp value
    `CharSequence` | `formatTuple(Tuple t)` Return a string representation of the given StreamBase Tuple value

- - ### Method Detail

    - #### formatBlob

          CharSequence formatBlob(ByteArrayView blob)

      Return a string representation of the given StreamBase blob value
      Parameters:
        `blob` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatTimestamp

          CharSequence formatTimestamp(Timestamp t)

      Return a string representation of the given StreamBase timestamp value
      Parameters:
        `t` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatString

          CharSequence formatString(String s)

      Return a string representation of the given StreamBase string value
      Parameters:
        `s` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatInt

          CharSequence formatInt(Integer i)

      Return a string representation of the given StreamBase integer value
      Parameters:
        `i` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatDouble

          CharSequence formatDouble(Double d)

      Return a string representation of the given StreamBase double value
      Parameters:
        `d` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatLong

          CharSequence formatLong(Long l)

      Return a string representation of the given StreamBase long value
      Parameters:
        `l` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatBool

          CharSequence formatBool(Boolean b)

      Return a string representation of the given StreamBase boolean value
      Parameters:
        `b` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatTuple

          CharSequence formatTuple(Tuple t)

      Return a string representation of the given StreamBase Tuple value
      Parameters:
        `t` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatList

          CharSequence formatList(CompleteDataType elementType,
                                  List<?> l)

      Return a string representation of the given StreamBase list
      Parameters:
        `elementType` - the data type of all list elements
        `l` - may be null
      Returns:
        a non-null string representation of the value given

    - #### formatFunction

          CharSequence formatFunction(Function f)

      Return a string representation of the given StreamBase function
      Parameters:
        `f` - may be null
      Returns:
        a non-null string representation of the value given
      Since:
        7.4

Copyright © 2015–2018 Cloud Software Group, Inc.. All rights reserved.