Interface RecordHelper

All Known Implementing Classes:
RecordHelperImpl

@InternalApi public interface RecordHelper
Helper class for working with java.lang.Record classes. This interface has different implementations depending on Java version.
Since:
1.5.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the canonical constructor for the given record class.
    boolean
    isRecord(Class<?> klass)
    Checks whether given class is a java.lang.Record.
  • Method Details

    • isRecord

      boolean isRecord(Class<?> klass)
      Checks whether given class is a java.lang.Record.
      Parameters:
      klass - to check
      Returns:
      true class is a record, false otherwise
      Since:
      1.5.0
    • getCanonicalConstructor

      Optional<Constructor<?>> getCanonicalConstructor(Class<?> recordClass)
      Returns the canonical constructor for the given record class.
      Parameters:
      recordClass - to return canonical constructor for
      Returns:
      canonical constructor or an empty result if not found
      Since:
      1.5.0