Class Wrapper<T>

java.lang.Object
com.pnfsoftware.jeb.util.base.Wrapper<T>
Type Parameters:
T -

public class Wrapper<T> extends Object
Wrap an object. Akin to Optional with support for null. This class implements hashCode() and equals(Object).
  • Field Details

    • NULL

      public static final Wrapper<?> NULL
  • Method Details

    • wrap

      public static <T> Wrapper<T> wrap(T object)
    • get

      public T get()
      Retrieve the wrapped value.
      Returns:
      the wrapped value, which may be null if null was wrapped
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object