Package com.mongodb

Class Jep395RecordCodecProvider

java.lang.Object
com.mongodb.Jep395RecordCodecProvider
All Implemented Interfaces:
CodecProvider

public class Jep395RecordCodecProvider extends Object implements CodecProvider
A CodecProvider for Java Records.

Requires java.lang.Record support - eg Java 17 or greater.

Since:
4.6
  • Constructor Details

    • Jep395RecordCodecProvider

      public Jep395RecordCodecProvider()
  • Method Details

    • get

      @Nullable public <T> Codec<T> get(Class<T> clazz, CodecRegistry registry)
      Specified by:
      get in interface CodecProvider
    • hasRecordSupport

      @VisibleForTesting(otherwise=PRIVATE) public boolean hasRecordSupport()
      Returns:
      true if records are supported