Class OptionalOf<V>

  • Type Parameters:
    V - The element type within the optional.
    All Implemented Interfaces:
    java.lang.reflect.ParameterizedType, java.lang.reflect.Type

    public final class OptionalOf<V>
    extends ParameterizedOf<java.util.Optional<V>>
    Represents an Optional with a specified element type, allowing for retention of the generic type V during deserialization by circumventing type erasure.
    • Constructor Summary

      Constructors 
      Constructor Description
      OptionalOf​(java.lang.Class<V> valueClass)
      Constructs an OptionalOf instance for the specified element type.
    • Method Summary

      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.reflect.Type

        getTypeName
    • Constructor Detail

      • OptionalOf

        public OptionalOf​(java.lang.Class<V> valueClass)
        Constructs an OptionalOf instance for the specified element type.
        Parameters:
        valueClass - The class of the elements contained in the optional.