Interface ValueUnboxer

  • All Known Implementing Classes:
    DefaultValueUnboxer

    @PublicSpi
    public interface ValueUnboxer
    A value unboxer takes values that are wrapped in classes like Optional / OptionalInt etc.. and returns value from them. You can provide your own implementation if you have your own specific holder classes.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static ValueUnboxer DEFAULT
      The default value unboxer handles JDK classes such as Optional and OptionalInt etc..
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.Object unbox​(java.lang.Object object)
      Unboxes 'object' if it is boxed in an Optional like type that this unboxer can handle.
    • Field Detail

      • DEFAULT

        static final ValueUnboxer DEFAULT
        The default value unboxer handles JDK classes such as Optional and OptionalInt etc..
    • Method Detail

      • unbox

        java.lang.Object unbox​(java.lang.Object object)
        Unboxes 'object' if it is boxed in an Optional like type that this unboxer can handle. Otherwise returns its input unmodified
        Parameters:
        object - to unbox
        Returns:
        unboxed object, or original if cannot unbox