Package com.mongodb

Class Jep395RecordCodecProvider

java.lang.Object
com.mongodb.Jep395RecordCodecProvider
All Implemented Interfaces:
org.bson.codecs.configuration.CodecProvider

public class Jep395RecordCodecProvider extends Object implements org.bson.codecs.configuration.CodecProvider
A CodecProvider for Java Records. Delegates to org.bson.codecs.record.RecordCodecProvider. If neither the runtime supports java.lang.Record, which was introduced in Java SE 17, nor org.bson.codecs.record.RecordCodecProvider is available, provides null.
Since:
4.6
  • Constructor Details

    • Jep395RecordCodecProvider

      public Jep395RecordCodecProvider()
  • Method Details

    • get

      @Nullable public <T> org.bson.codecs.Codec<T> get(Class<T> clazz, org.bson.codecs.configuration.CodecRegistry registry)
      Specified by:
      get in interface org.bson.codecs.configuration.CodecProvider
    • get

      @Nullable public <T> org.bson.codecs.Codec<T> get(Class<T> clazz, List<Type> typeArguments, org.bson.codecs.configuration.CodecRegistry registry)
      Specified by:
      get in interface org.bson.codecs.configuration.CodecProvider
    • hasRecordSupport

      @VisibleForTesting(otherwise=PRIVATE) public boolean hasRecordSupport()
      This method is not part of the public API and may be removed or changed at any time.
      Returns:
      true if records are supported