T - expression type@Immutable public abstract class MappingProjection<T> extends ExpressionBase<T> implements FactoryExpression<T>
Example
MappingProjection<Pair<String,String>> mapping = new MappingProjection<Pair<String,String>>(Pair.class, str1, str2) {
@Override
protected Pair<String, String> map(Tuple row) {
return Pair.of(row.get(str1), row.get(str2));
}
};
| Constructor and Description |
|---|
MappingProjection(Class<? super T> type,
Expression<?>... args)
Create a new MappingProjection instance
|
MappingProjection(Class<? super T> type,
Expression<?>[]... args)
Create a new MappingProjection instance
|
| Modifier and Type | Method and Description |
|---|---|
<R,C> R |
accept(Visitor<R,C> v,
C context)
Accept the visitor with the given context
|
List<Expression<?>> |
getArgs()
Get the invocation arguments
|
protected abstract T |
map(Tuple row)
Creates a result object from the given row.
|
T |
newInstance(Object... values)
Create a projection with the given arguments
|
getType, hashCode, toStringclone, equals, finalize, getClass, notify, notifyAll, wait, wait, waitgetTypepublic MappingProjection(Class<? super T> type, Expression<?>... args)
type - args - public MappingProjection(Class<? super T> type, Expression<?>[]... args)
type - args - public T newInstance(Object... values)
FactoryExpressionnewInstance in interface FactoryExpression<T>protected abstract T map(Tuple row)
row - The row to mappublic List<Expression<?>> getArgs()
FactoryExpressiongetArgs in interface FactoryExpression<T>public <R,C> R accept(Visitor<R,C> v, @Nullable C context)
Expressionaccept in interface Expression<T>R - return typeC - context typev - visitorcontext - context of visitCopyright © 2007–2014 Mysema Ltd. All rights reserved.