Class Generic


  • public final class Generic
    extends java.lang.Object
    A helper class for providing static access to parameterized generic types, aiding in deserialization by circumventing type erasure.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <E> ListOf<E> listOf​(java.lang.Class<E> elementClass)
      Creates a ListOf instance for the specified element type.
      static <K extends java.lang.String,​V>
      MapOf<K,​V>
      mapOf​(java.lang.Class<V> valueClass)
      Creates a MapOf instance for a map with String keys and the specified value type.
      static <E> NullableDocumentOf<E> nullableDocumentOf​(java.lang.Class<E> valueClass)
      Creates a NullableDocumentOf instance for the specified element type.
      static <E> OptionalOf<E> optionalOf​(java.lang.Class<E> valueClass)
      Creates an OptionalOf instance for the specified element type.
      static <E> PageOf<E> pageOf​(java.lang.Class<E> valueClass)
      Creates a PageOf instance for the specified element type.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • listOf

        public static <E> ListOf<E> listOf​(java.lang.Class<E> elementClass)
        Creates a ListOf instance for the specified element type.
        Type Parameters:
        E - The type of elements in the list.
        Parameters:
        elementClass - The class of the elements contained in the list.
        Returns:
        A ListOf instance with the specified element type.
      • mapOf

        public static <K extends java.lang.String,​V> MapOf<K,​V> mapOf​(java.lang.Class<V> valueClass)
        Creates a MapOf instance for a map with String keys and the specified value type.
        Type Parameters:
        K - The type of keys in the map (constrained to String).
        V - The type of values in the map.
        Parameters:
        valueClass - The class of the map's values.
        Returns:
        A MapOf instance with String keys and the specified value type.
      • pageOf

        public static <E> PageOf<E> pageOf​(java.lang.Class<E> valueClass)
        Creates a PageOf instance for the specified element type.
        Type Parameters:
        E - The type of elements in the page.
        Parameters:
        valueClass - The class of the elements contained in the page.
        Returns:
        A PageOf instance with the specified element type.
      • optionalOf

        public static <E> OptionalOf<E> optionalOf​(java.lang.Class<E> valueClass)
        Creates an OptionalOf instance for the specified element type.
        Type Parameters:
        E - The type of the element in the optional.
        Parameters:
        valueClass - The class of the elements contained in the optional.
        Returns:
        An OptionalOf instance with the specified element type.
      • nullableDocumentOf

        public static <E> NullableDocumentOf<E> nullableDocumentOf​(java.lang.Class<E> valueClass)
        Creates a NullableDocumentOf instance for the specified element type.
        Type Parameters:
        E - The type of the element in the nullable document.
        Parameters:
        valueClass - The class of the elements contained in the nullable document.
        Returns:
        A NullableDocumentOf instance with the specified element type.