Class MapCodec

  • All Implemented Interfaces:
    Codec<java.util.Map<java.lang.String,​java.lang.Object>>, Decoder<java.util.Map<java.lang.String,​java.lang.Object>>, Encoder<java.util.Map<java.lang.String,​java.lang.Object>>, OverridableUuidRepresentationCodec<java.util.Map<java.lang.String,​java.lang.Object>>

    @Deprecated(since="2022-10-31")
    public class MapCodec
    extends java.lang.Object
    implements Codec<java.util.Map<java.lang.String,​java.lang.Object>>, OverridableUuidRepresentationCodec<java.util.Map<java.lang.String,​java.lang.Object>>
    Deprecated.
    Usage of this API is not supported in AEM as a Cloud Service.
    A Codec for Map instances.
    Since:
    3.5
    • Constructor Summary

      Constructors 
      Constructor Description
      MapCodec()
      Deprecated.
      Construct a new instance with a default CodecRegistry
      MapCodec​(CodecRegistry registry)
      Deprecated.
      Construct a new instance with the given registry
      MapCodec​(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap)
      Deprecated.
      Construct a new instance with the given registry and BSON type class map.
      MapCodec​(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap, Transformer valueTransformer)
      Deprecated.
      Construct a new instance with the given registry and BSON type class map.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      java.util.Map<java.lang.String,​java.lang.Object> decode​(BsonReader reader, DecoderContext decoderContext)
      Deprecated.
      Decodes a BSON value from the given reader into an instance of the type parameter T.
      void encode​(BsonWriter writer, java.util.Map<java.lang.String,​java.lang.Object> map, EncoderContext encoderContext)
      Deprecated.
      Encode an instance of the type parameter T into a BSON value.
      java.lang.Class<java.util.Map<java.lang.String,​java.lang.Object>> getEncoderClass()
      Deprecated.
      Returns the Class instance that this encodes.
      Codec<java.util.Map<java.lang.String,​java.lang.Object>> withUuidRepresentation​(UuidRepresentation uuidRepresentation)
      Deprecated.
      Implementations must return a new instance with the UuidRepresentation overridden with the given value.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MapCodec

        public MapCodec()
        Deprecated.
        Construct a new instance with a default CodecRegistry
      • MapCodec

        public MapCodec​(CodecRegistry registry)
        Deprecated.
        Construct a new instance with the given registry
        Parameters:
        registry - the registry
      • MapCodec

        public MapCodec​(CodecRegistry registry,
                        BsonTypeClassMap bsonTypeClassMap)
        Deprecated.
        Construct a new instance with the given registry and BSON type class map.
        Parameters:
        registry - the registry
        bsonTypeClassMap - the BSON type class map
      • MapCodec

        public MapCodec​(CodecRegistry registry,
                        BsonTypeClassMap bsonTypeClassMap,
                        Transformer valueTransformer)
        Deprecated.
        Construct a new instance with the given registry and BSON type class map. The transformer is applied as a last step when decoding values, which allows users of this codec to control the decoding process. For example, a user of this class could substitute a value decoded as a Document with an instance of a special purpose class (e.g., one representing a DBRef in MongoDB).
        Parameters:
        registry - the registry
        bsonTypeClassMap - the BSON type class map
        valueTransformer - the value transformer to use as a final step when decoding the value of any field in the map
    • Method Detail

      • withUuidRepresentation

        public Codec<java.util.Map<java.lang.String,​java.lang.Object>> withUuidRepresentation​(UuidRepresentation uuidRepresentation)
        Deprecated.
        Description copied from interface: OverridableUuidRepresentationCodec
        Implementations must return a new instance with the UuidRepresentation overridden with the given value.
        Specified by:
        withUuidRepresentation in interface OverridableUuidRepresentationCodec<java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        uuidRepresentation - the UuidRepresentation
        Returns:
        a new instance equivalent to this but with the given UuidRepresentation
      • encode

        public void encode​(BsonWriter writer,
                           java.util.Map<java.lang.String,​java.lang.Object> map,
                           EncoderContext encoderContext)
        Deprecated.
        Description copied from interface: Encoder
        Encode an instance of the type parameter T into a BSON value.
        Specified by:
        encode in interface Encoder<java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        writer - the BSON writer to encode into
        map - the value to encode
        encoderContext - the encoder context
      • decode

        public java.util.Map<java.lang.String,​java.lang.Object> decode​(BsonReader reader,
                                                                             DecoderContext decoderContext)
        Deprecated.
        Description copied from interface: Decoder
        Decodes a BSON value from the given reader into an instance of the type parameter T.
        Specified by:
        decode in interface Decoder<java.util.Map<java.lang.String,​java.lang.Object>>
        Parameters:
        reader - the BSON reader
        decoderContext - the decoder context
        Returns:
        an instance of the type parameter T.
      • getEncoderClass

        public java.lang.Class<java.util.Map<java.lang.String,​java.lang.Object>> getEncoderClass()
        Deprecated.
        Description copied from interface: Encoder
        Returns the Class instance that this encodes. This is necessary because Java does not reify generic types.
        Specified by:
        getEncoderClass in interface Encoder<java.util.Map<java.lang.String,​java.lang.Object>>
        Returns:
        the Class instance that this encodes.