インターフェース RedisJsonSerializer.Splitter

すべてのスーパーインターフェース:
RedisJsonSerializer, RedisSerializer<ObjectSE>
すべての既知の実装クラス:
GenericJackson2JsonRedisSerializer, GenericJacksonJsonRedisSerializer
含まれているインターフェース:
RedisJsonSerializer

public static interface RedisJsonSerializer.Splitter extends RedisJsonSerializer
Splitter for JSON arrays and objects.
導入:
4.2
作成者:
Moritz Halbritter
  • 方法の詳細

    • splitArray

      default ListSE<byte[]> splitArray(byte[] source) throws SerializationException
      Extract immediate elements of a JSON array as individual JSON values.

      メモ: The default implementation deserializes the array and serializes each element separately. This may change number formatting or precision. For example, 1.10 may become 1.1. Implementations should override this method to preserve the original bytes of each element.

      パラメーター:
      source - the JSON array to read.
      戻り値:
      the JSON bytes for each element in array order, or an empty list if the array is empty.
      例外:
      SerializationException - if the source is not a JSON array or cannot be read.
    • splitObject

      default MapSE<StringSE,byte[]> splitObject(byte[] source) throws SerializationException
      Extract the immediate members of a JSON object as individual JSON values.

      メモ: Map keys contain the unescaped member names. Values contain the JSON bytes for each member. The default implementation deserializes the object and serializes each member value separately. See splitArray(byte[]) for the effect on number formatting and precision.

      パラメーター:
      source - the JSON object to read.
      戻り値:
      the members in source order, or an empty map if the object is empty.
      例外:
      SerializationException - if the source is not a JSON object or cannot be read.
    • joinObject

      default byte[] joinObject(MapSE<StringSE,byte[]> members) throws SerializationException
      Create a JSON object from the given members.

      Map keys supply the member names, which are escaped as needed. Each value must contain a valid JSON value. Members are written in map iteration order.

      メモ: The default implementation deserializes the member values and serializes the resulting object. See splitArray(byte[]) for the effect on number formatting and precision. Implementations can override this method to preserve the supplied JSON bytes for each value.

      パラメーター:
      members - the member names and their JSON bytes.
      戻り値:
      the JSON object as bytes, or the representation of {} if the map is empty.
      例外:
      SerializationException - if the object cannot be written.
      関連事項: