com.anasoft.os.daofusion.bitemporal
Class WrappedValueAccessor<V,T extends BitemporalWrapper<V>>

java.lang.Object
  extended by com.anasoft.os.daofusion.bitemporal.WrappedValueAccessor<V,T>
Type Parameters:
V - Value wrapped by the Bitemporal object.
T - BitemporalWrapper implementation that wraps the given value type.
All Implemented Interfaces:
ValueAccessor<V,T>, java.io.Serializable

public abstract class WrappedValueAccessor<V,T extends BitemporalWrapper<V>>
extends java.lang.Object
implements ValueAccessor<V,T>

ValueAccessor adapter for use with BitemporalWrapper.

Author:
igor.mihalik
See Also:
ValueAccessor, BitemporalWrapper, Serialized Form

Constructor Summary
WrappedValueAccessor()
           
 
Method Summary
static
<V,T extends BitemporalWrapper<V>>
WrappedValueAccessor<V,T>
create(java.lang.Class<T> clazz)
          Creates an instance of WrappedValueAccessor for the given BitemporalWrapper type.
 V extractValue(T bitemporalObject)
          Extract the value from the given Bitemporal object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.anasoft.os.daofusion.bitemporal.ValueAccessor
wrapValue
 

Constructor Detail

WrappedValueAccessor

public WrappedValueAccessor()
Method Detail

extractValue

public V extractValue(T bitemporalObject)
Description copied from interface: ValueAccessor
Extract the value from the given Bitemporal object.

Specified by:
extractValue in interface ValueAccessor<V,T extends BitemporalWrapper<V>>
See Also:
ValueAccessor.extractValue(com.anasoft.os.daofusion.bitemporal.Bitemporal)

create

public static <V,T extends BitemporalWrapper<V>> WrappedValueAccessor<V,T> create(java.lang.Class<T> clazz)
Creates an instance of WrappedValueAccessor for the given BitemporalWrapper type.

Resulting instance implements the wrapValue method using the following algorithm:

  1. invoke the default no-argument constructor for the given BitemporalWrapper class (the constructor doesn't need to be public)
  2. set the wrapped value and validity interval on newly created BitemporalWrapper instance
  3. return the BitemporalWrapper instance as the result



Copyright © 2008-2009 ANASOFT and contributors. All Rights Reserved.