Class JsonValueToJsonBytesConverter

  • All Implemented Interfaces:
    Converter<org.forgerock.json.JsonValue,​byte[]>

    public class JsonValueToJsonBytesConverter
    extends Object
    implements Converter<org.forgerock.json.JsonValue,​byte[]>
    A custom converter that converted JsonValues to byte arrays.
    Since:
    13.0.0
    • Constructor Detail

      • JsonValueToJsonBytesConverter

        @Inject
        public JsonValueToJsonBytesConverter​(@Named("cts-json-object-mapper")
                                             com.fasterxml.jackson.databind.ObjectMapper mapper)
        Constructs a new JsonValueToJsonBytesConverter instance.
        Parameters:
        mapper - A ObjectMapper instance.
    • Method Detail

      • convertFrom

        public byte[] convertFrom​(org.forgerock.json.JsonValue jsonValue)
        Description copied from interface: Converter
        Converts the object from its original format.
        Specified by:
        convertFrom in interface Converter<org.forgerock.json.JsonValue,​byte[]>
        Parameters:
        jsonValue - The object being converted.
        Returns:
        The converted object.
      • convertBack

        public org.forgerock.json.JsonValue convertBack​(byte[] bytes)
        Description copied from interface: Converter
        Converts the object back to its original format.
        Specified by:
        convertBack in interface Converter<org.forgerock.json.JsonValue,​byte[]>
        Parameters:
        bytes - The object being converted.
        Returns:
        The converted object.