Class AbstractWrapper<BASIC>

java.lang.Object
org.seasar.doma.wrapper.AbstractWrapper<BASIC>
Type Parameters:
BASIC - the basic type
All Implemented Interfaces:
Wrapper<BASIC>
Direct Known Subclasses:
ArrayWrapper, BigDecimalWrapper, BigIntegerWrapper, BlobWrapper, BooleanWrapper, BytesWrapper, ByteWrapper, ClobWrapper, DateWrapper, DoubleWrapper, EnumWrapper, FloatWrapper, IntegerWrapper, LocalDateTimeWrapper, LocalDateWrapper, LocalTimeWrapper, LongWrapper, NClobWrapper, ObjectWrapper, ShortWrapper, SQLXMLWrapper, StringWrapper, TimestampWrapper, TimeWrapper, UtilDateWrapper

public abstract class AbstractWrapper<BASIC> extends Object implements Wrapper<BASIC>
A skeletal implementation for the Wrapper interface .
  • Field Details

    • basicClass

      protected final Class<BASIC> basicClass
    • value

      protected BASIC value
  • Constructor Details

    • AbstractWrapper

      protected AbstractWrapper(Class<BASIC> basicClass)
    • AbstractWrapper

      protected AbstractWrapper(Class<BASIC> basicClass, BASIC value)
  • Method Details

    • set

      public final void set(BASIC value)
      Description copied from interface: Wrapper
      Sets the value.
      Specified by:
      set in interface Wrapper<BASIC>
      Parameters:
      value - the value
    • doSet

      protected void doSet(BASIC value)
    • get

      public final BASIC get()
      Description copied from interface: Wrapper
      Returns the value.

      The value may be null.

      Specified by:
      get in interface Wrapper<BASIC>
      Returns:
      the value.
    • doGet

      protected BASIC doGet()
    • getCopy

      public final BASIC getCopy()
      Description copied from interface: Wrapper
      Return a copy of the value.
      Specified by:
      getCopy in interface Wrapper<BASIC>
      Returns:
      a copy of the value
    • doGetCopy

      protected BASIC doGetCopy()
    • getDefault

      public BASIC getDefault()
      Description copied from interface: Wrapper
      Returns the default value.
      Specified by:
      getDefault in interface Wrapper<BASIC>
      Returns:
      the boxed default value of a primitive type if this is a wrapper for a boxed type, else null
    • hasEqualValue

      public final boolean hasEqualValue(Object otherValue)
      Description copied from interface: Wrapper
      Whether this object has an equal value to the other one.
      Specified by:
      hasEqualValue in interface Wrapper<BASIC>
      Parameters:
      otherValue - the other object
      Returns:
      true if this object has an equal value to the other one.
    • doHasEqualValue

      protected boolean doHasEqualValue(Object otherValue)
    • getBasicClass

      public Class<BASIC> getBasicClass()
      Description copied from interface: Wrapper
      Returns the class of the basic type.
      Specified by:
      getBasicClass in interface Wrapper<BASIC>
      Returns:
      the class of the basic type
    • toString

      public String toString()
      Overrides:
      toString in class Object