Interface Wrapper<BASIC>

Type Parameters:
BASIC - The basic type
All Known Subinterfaces:
NumberWrapper<BASIC>
All Known Implementing Classes:
AbstractWrapper, ArrayWrapper, BigDecimalWrapper, BigIntegerWrapper, BlobWrapper, BooleanWrapper, BytesWrapper, ByteWrapper, ClobWrapper, DateWrapper, DoubleWrapper, EnumWrapper, FloatWrapper, IntegerWrapper, LocalDateTimeWrapper, LocalDateWrapper, LocalTimeWrapper, LongWrapper, NClobWrapper, ObjectWrapper, PrimitiveBooleanWrapper, PrimitiveByteWrapper, PrimitiveDoubleWrapper, PrimitiveFloatWrapper, PrimitiveIntWrapper, PrimitiveLongWrapper, PrimitiveShortWrapper, ShortWrapper, SQLXMLWrapper, StringWrapper, TimestampWrapper, TimeWrapper, UtilDateWrapper

public interface Wrapper<BASIC>
A wrapper for a basic type.

The implementation instance is not required to be thread safe.

  • Method Details

    • get

      BASIC get()
      Returns the value.

      The value may be null.

      Returns:
      the value.
    • set

      void set(BASIC value)
      Sets the value.
      Parameters:
      value - the value
    • getCopy

      BASIC getCopy()
      Return a copy of the value.
      Returns:
      a copy of the value
    • getDefault

      BASIC getDefault()
      Returns the default value.
      Returns:
      the boxed default value of a primitive type if this is a wrapper for a boxed type, else null
    • hasEqualValue

      boolean hasEqualValue(Object other)
      Whether this object has an equal value to the other one.
      Parameters:
      other - the other object
      Returns:
      true if this object has an equal value to the other one.
    • getBasicClass

      Class<BASIC> getBasicClass()
      Returns the class of the basic type.
      Returns:
      the class of the basic type
    • isPrimitiveWrapper

      default boolean isPrimitiveWrapper()
      Whether this object is a wrapper for a primitive type.
      Returns:
      true if this object is a wrapper for a primitive type.
    • accept

      <R, P, Q, TH extends Throwable> R accept(WrapperVisitor<R,P,Q,TH> visitor, P p, Q q) throws TH
      Accept a visitor.
      Type Parameters:
      R - The result
      P - The first parameter type
      Q - The second parameter type
      TH - The error or exception type
      Parameters:
      visitor - the visitor
      p - the first parameter
      q - the second parameter
      Returns:
      the result
      Throws:
      TH - the error or exception type
      DomaNullPointerException - if visitor is null