Class JsonMetadataSerializer

  • All Implemented Interfaces:<Metadata>

    public class JsonMetadataSerializer
    extends Object
    Serializer for Metadata If overriding this, remember that this is called from a static context. Share state only with great caution.
    • Constructor Detail

      • JsonMetadataSerializer

        public JsonMetadataSerializer()
    • Method Detail

      • serialize

        public serialize​(Metadata metadata,
                                                     Type type,
        Serializes a Metadata object into effectively Map.
        Specified by:
        serialize in interface<Metadata>
        metadata - object to serialize
        type - (ignored)
        context - (ignored)
        JsonElement with key/value(s) pairs or JsonNull if metadata is null.
      • getNames

        protected String[] getNames​(Metadata metadata)
        Override to get a custom sort order or to filter names.
        metadata - metadata from which to grab names
        list of names in the order in which they should be serialized