net.sf.molae.pipe.union
Class Extendable<T>

java.lang.Object
  extended by net.sf.molae.pipe.basic.ObjectProxy<B>
      extended by net.sf.molae.pipe.union.ObjectUnion<Object,T,Object>
          extended by net.sf.molae.pipe.union.Extendable<T>
Direct Known Subclasses:
Bound

public class Extendable<T>
extends ObjectUnion<Object,T,Object>

An extendable can either be of its base type (T) or of another instance. It is useful if there is a requirement for values with special behavior that must not be null.

Since:
2.0

Nested Class Summary
protected static class Extendable.ExtendableTransformer<T>
          A transformer that returns a new extendable of the input value.
 
Constructor Summary
Extendable()
          Creates a new instance with an undefined base value.
Extendable(T base)
          Creates a new extendable with the specified base value.
 
Method Summary
 T getValue()
          Returns the base value of this extendable.
static
<T> TwoWayTransformer<T,Extendable<T>>
toExtendableTransformer()
          Returns a transformer that returns a new extendable of the input value.
 
Methods inherited from class net.sf.molae.pipe.union.ObjectUnion
getBase1, getBase2, isOfType1, newInstance1, newInstance2
 
Methods inherited from class net.sf.molae.pipe.basic.ObjectProxy
assertNotNull, equals, getBase, hashCode, toString, toVerboseString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Extendable

public Extendable(T base)
Creates a new extendable with the specified base value.

Parameters:
base - the base value of the new extendable

Extendable

public Extendable()
Creates a new instance with an undefined base value.

Method Detail

getValue

public T getValue()
Returns the base value of this extendable.

Returns:
the base value of this extendable

toExtendableTransformer

public static <T> TwoWayTransformer<T,Extendable<T>> toExtendableTransformer()
Returns a transformer that returns a new extendable of the input value.

Returns:
a transformer that returns a new extendable of the input value.