Class DigestParamsCodec

java.lang.Object
io.meeds.commons.digest.service.DigestParamsCodec

public final class DigestParamsCodec extends Object
Writes and reads back the PARAMS column of a waiting item: a small JSON object of strings, ids only. Written at capture, read at send time.
  • Method Details

    • serialize

      public static String serialize(Map<String,String> ownerParameters)
      Parameters:
      ownerParameters - the parameters the notification plugin stored
      Returns:
      the JSON to store, null when there is nothing worth storing
    • fragment

      public static String fragment(String name, String value)
      Parameters:
      name - a parameter name
      value - its value
      Returns:
      the fragment a stored JSON contains for this parameter, used to find the items about one object
    • parse

      public static Map<String,String> parse(String json)
      Parameters:
      json - the stored PARAMS, as written by serialize(Map)
      Returns:
      the parameters, in storage order, empty when nothing was stored or when the content is not what this codec writes