接口 JsonWriter.PairExtractor<E>

类型参数:
E - the element type
封闭接口:
JsonWriter<T>

public static interface JsonWriter.PairExtractor<E>
Interface that can be used to extract name/value pairs from an element.
  • 方法详细资料

    • getName

      <N> N getName(E element)
      Extract the name.
      类型参数:
      N - the name type
      参数:
      element - the source element
      返回:
      the extracted name
    • getValue

      <V> V getValue(E element)
      Extract the name.
      类型参数:
      V - the value type
      参数:
      element - the source element
      返回:
      the extracted value
    • of

      static <T> JsonWriter.PairExtractor<T> of(Function<T,?> nameExtractor, Function<T,?> valueExtractor)
      Factory method to create a JsonWriter.PairExtractor using distinct name and value extraction functions.
      类型参数:
      T - the element type
      参数:
      nameExtractor - the name extractor
      valueExtractor - the value extraction
      返回:
      a new JsonWriter.PairExtractor instance