All Known Implementing Classes:
DefaultOption, KeyspaceOption, TableOption, TableOption.CachingOption, TableOption.CompactionOption, TableOption.CompressionOption

public interface Option
Interface to represent option types.
Author:
Matthew T. Adams
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Checks that the given value can be coerced into the type given by getType().
    boolean
    Whether this option should escape single quotes in its value.
    The (usually lower-cased, underscore-separated) name of this table option.
    The type that values must be able to be coerced into for this option.
    boolean
    Tests whether the given value can be coerced into the type given by getType().
    boolean
    Whether this option's value should be single-quoted.
    boolean
    Whether this option requires a value.
    boolean
    Whether this option takes a value.
    First ensures that the given value is coerceable into the type expected by this option, then returns the result of Object.toString() called on the given value.
  • Method Details

    • getType

      Class<?> getType()
      The type that values must be able to be coerced into for this option.
    • getName

      String getName()
      The (usually lower-cased, underscore-separated) name of this table option.
    • takesValue

      boolean takesValue()
      Whether this option takes a value.
    • escapesValue

      boolean escapesValue()
      Whether this option should escape single quotes in its value.
    • quotesValue

      boolean quotesValue()
      Whether this option's value should be single-quoted.
    • requiresValue

      boolean requiresValue()
      Whether this option requires a value.
    • checkValue

      void checkValue(Object value)
      Checks that the given value can be coerced into the type given by getType().
    • isCoerceable

      boolean isCoerceable(Object value)
      Tests whether the given value can be coerced into the type given by getType().
    • toString

      String toString(@Nullable Object value)
      First ensures that the given value is coerceable into the type expected by this option, then returns the result of Object.toString() called on the given value. If this option is escaping quotes (escapesValue() is true), then single quotes will be escaped, and if this option is quoting values ( quotesValue() is true), then the value will be surrounded by single quotes. Given null, returns an empty string.
      See Also: