Class GenericWrapper<T>

java.lang.Object
com.helixframework.generics.GenericWrapper<T>
Type Parameters:
T - type of wrapped object
All Implemented Interfaces:
Wrapper

public class GenericWrapper<T> extends Object implements Wrapper
Generic wrapper implementation.
  • Constructor Details

    • GenericWrapper

      public GenericWrapper(T wrapped)
      Wraps the supplied object.
      Parameters:
      wrapped - object to wrap
  • Method Details

    • unwrap

      public <T> T unwrap(Class<T> clazz)
      Description copied from interface: Wrapper
      Unwraps the wrapped object.
      Specified by:
      unwrap in interface Wrapper
      Type Parameters:
      T - unwrapped object type
      Parameters:
      clazz - unwrapped object type
      Returns:
      unwrapped object
    • isWrapperFor

      public boolean isWrapperFor(Class<?> clazz)
      Description copied from interface: Wrapper
      Checks if this instance of Wrapper is a wrapper of the specified type.
      Specified by:
      isWrapperFor in interface Wrapper
      Parameters:
      clazz - wrapped type
      Returns:
      true if the this wrapper is a wrapper for the specified type; otherwise false
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object