org.apache.openjpa.persistence
Class TupleImpl
java.lang.Object
org.apache.openjpa.persistence.TupleImpl
- All Implemented Interfaces:
- Tuple
public class TupleImpl
- extends Object
- implements Tuple
Tuple holds a set of values corresponding to a set of TupleElement
.
This implementation prefers index-based access.
A Tuple instance is constructed by a TupleFactory.
The TupleElemets are shared across all the tuple instances.
- Author:
- Pinaki Poddar
Constructor Summary |
TupleImpl(TupleFactory factory)
Supply the factory that creates prototypes and holds the elements. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PUT
public static Method PUT
TupleImpl
TupleImpl(TupleFactory factory)
- Supply the factory that creates prototypes and holds the elements.
get
public <X> X get(TupleElement<X> tupleElement)
- Specified by:
get
in interface Tuple
get
public <X> X get(String alias,
Class<X> type)
- Specified by:
get
in interface Tuple
get
public Object get(String alias)
- Specified by:
get
in interface Tuple
get
public <X> X get(int i,
Class<X> type)
- Specified by:
get
in interface Tuple
get
public Object get(int i)
- Specified by:
get
in interface Tuple
toArray
public Object[] toArray()
- Specified by:
toArray
in interface Tuple
getElements
public List<TupleElement<?>> getElements()
- Specified by:
getElements
in interface Tuple
put
public void put(Integer key,
Object value)
- Put the value at the given key index.
This is invoked by the kernel to populate a Tuple.
assertAndConvertType
<X> X assertAndConvertType(String id,
Object value,
Class<X> type)
- Assert that the given value is convertible to the given type and convert.
null type implies no conversion and a pure cast.
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.