|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.op4j.functions.Function<T,R> org.op4j.functions.Get<T,R>
public final class Get<T,R>
Function hub class for executing attribute getters in target objects.
Method Summary | ||
---|---|---|
static
|
arrayOf(org.javaruntype.type.Type<R> resultType,
String attributeName)
Abbreviation for { attrOfArrayOf(Type, String) . |
|
static Function<Object,String[]> |
arrayOfString(String attributeName)
Abbreviation for { attrOfArrayOfString(String) . |
|
static
|
attrOf(org.javaruntype.type.Type<R> resultType,
String attributeName)
Executes a getter (getX()) on the target object which returns R, being R the specified type. |
|
static
|
attrOfArrayOf(org.javaruntype.type.Type<R> resultType,
String attributeName)
Executes a getter (getX()) on the target object which returns R[], being R the specified type. |
|
static Function<Object,String[]> |
attrOfArrayOfString(String attributeName)
Executes a getter (getX()) on the target object which returns String[]. |
|
static Function<Object,BigDecimal> |
attrOfBigDecimal(String attributeName)
Executes a getter (getX()) on the target object which returns BigDecimal. |
|
static Function<Object,BigInteger> |
attrOfBigInteger(String attributeName)
Executes a getter (getX()) on the target object which returns BigInteger. |
|
static Function<Object,Boolean> |
attrOfBoolean(String attributeName)
Executes a getter (getX()) on the target object which returns Boolean. |
|
static Function<Object,Byte> |
attrOfByte(String attributeName)
Executes a getter (getX()) on the target object which returns Byte. |
|
static Function<Object,Calendar> |
attrOfCalendar(String attributeName)
Executes a getter (getX()) on the target object which returns Calendar. |
|
static Function<Object,Character> |
attrOfCharacter(String attributeName)
Executes a getter (getX()) on the target object which returns Character. |
|
static Function<Object,Date> |
attrOfDate(String attributeName)
Executes a getter (getX()) on the target object which returns Date. |
|
static Function<Object,Double> |
attrOfDouble(String attributeName)
Executes a getter (getX()) on the target object which returns Double. |
|
static Function<Object,Float> |
attrOfFloat(String attributeName)
Executes a getter (getX()) on the target object which returns Float. |
|
static Function<Object,Integer> |
attrOfInteger(String attributeName)
Executes a getter (getX()) on the target object which returns Integer. |
|
static
|
attrOfListOf(org.javaruntype.type.Type<R> resultType,
String attributeName)
Executes a getter (getX()) on the target object which returns List<R>, being R the specified type. |
|
static Function<Object,List<String>> |
attrOfListOfString(String attributeName)
Executes a getter (getX()) on the target object which returns List<String>. |
|
static Function<Object,Long> |
attrOfLong(String attributeName)
Executes a getter (getX()) on the target object which returns Long. |
|
static Function<Object,Object> |
attrOfObject(String attributeName)
Executes a getter (getX()) on the target object which returns Object. |
|
static
|
attrOfSetOf(org.javaruntype.type.Type<R> resultType,
String attributeName)
Executes a getter (getX()) on the target object which returns Set<R>, being R the specified type. |
|
static Function<Object,Set<String>> |
attrOfSetOfString(String attributeName)
Executes a getter (getX()) on the target object which returns Set<String>. |
|
static Function<Object,Short> |
attrOfShort(String attributeName)
Executes a getter (getX()) on the target object which returns Short. |
|
static Function<Object,String> |
attrOfString(String attributeName)
Executes a getter (getX()) on the target object which returns String. |
|
static Function<Object,Byte> |
b(String attributeName)
Abbreviation for { attrOfByte(String) . |
|
static Function<Object,BigDecimal> |
bigDecimal(String attributeName)
Abbreviation for { attrOfBigDecimal(String) . |
|
static Function<Object,BigInteger> |
bigInteger(String attributeName)
Abbreviation for { attrOfBigInteger(String) . |
|
static Function<Object,Boolean> |
bool(String attributeName)
Abbreviation for { attrOfBoolean(String) . |
|
static Function<Object,Character> |
c(String attributeName)
Abbreviation for { attrOfCharacter(String) . |
|
static Function<Object,Calendar> |
calendar(String attributeName)
Abbreviation for { attrOfCalendar(String) . |
|
static Function<Object,Double> |
d(String attributeName)
Abbreviation for { attrOfDouble(String) . |
|
static Function<Object,Date> |
date(String attributeName)
Abbreviation for { attrOfDate(String) . |
|
R |
execute(T input,
ExecCtx ctx)
Executes the function on the current target object, which is passed as the input parameter. |
|
static Function<Object,Float> |
f(String attributeName)
Abbreviation for { attrOfFloat(String) . |
|
static Function<Object,Integer> |
i(String attributeName)
Abbreviation for { attrOfInteger(String) . |
|
static Function<Object,Long> |
l(String attributeName)
Abbreviation for { attrOfLong(String) . |
|
static
|
listOf(org.javaruntype.type.Type<R> resultType,
String attributeName)
Abbreviation for { attrOfListOf(Type, String) . |
|
static Function<Object,List<String>> |
listOfString(String attributeName)
Abbreviation for { attrOfListOfString(String) . |
|
static Function<Object,Object> |
obj(String attributeName)
Abbreviation for { attrOfObject(String) . |
|
static
|
obj(org.javaruntype.type.Type<R> resultType,
String attributeName)
Abbreviation for { attrOf(Type, String) . |
|
static Function<Object,String> |
s(String attributeName)
Abbreviation for { attrOfString(String) . |
|
static
|
setOf(org.javaruntype.type.Type<R> resultType,
String attributeName)
Abbreviation for { attrOfSetOf(Type, String) . |
|
static Function<Object,Set<String>> |
setOfString(String attributeName)
Abbreviation for { attrOfSetOfString(String) . |
|
static Function<Object,Short> |
shr(String attributeName)
Abbreviation for { attrOfShort(String) . |
Methods inherited from class org.op4j.functions.Function |
---|
execute |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Function<Object,Object> attrOfObject(String attributeName)
Executes a getter (getX()) on the target object which returns Object. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Object> obj(String attributeName)
Abbreviation for {attrOfObject(String)
.
attributeName
- the name of the attribute
public static <R> Function<Object,R> attrOf(org.javaruntype.type.Type<R> resultType, String attributeName)
Executes a getter (getX()) on the target object which returns R, being R the specified type.
If the specified attribute is, for example, "name", the called method will be "getName()".
resultType
- the type of the attributeattributeName
- the name of the attribute
public static <R> Function<Object,R> obj(org.javaruntype.type.Type<R> resultType, String attributeName)
Abbreviation for {attrOf(Type, String)
.
resultType
- the type of the attributeattributeName
- the name of the attribute
public static Function<Object,BigInteger> attrOfBigInteger(String attributeName)
Executes a getter (getX()) on the target object which returns BigInteger. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,BigInteger> bigInteger(String attributeName)
Abbreviation for {attrOfBigInteger(String)
.
attributeName
- the name of the attribute
public static Function<Object,BigDecimal> attrOfBigDecimal(String attributeName)
Executes a getter (getX()) on the target object which returns BigDecimal. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,BigDecimal> bigDecimal(String attributeName)
Abbreviation for {attrOfBigDecimal(String)
.
attributeName
- the name of the attribute
public static Function<Object,Boolean> attrOfBoolean(String attributeName)
Executes a getter (getX()) on the target object which returns Boolean. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Boolean> bool(String attributeName)
Abbreviation for {attrOfBoolean(String)
.
attributeName
- the name of the attribute
public static Function<Object,Byte> attrOfByte(String attributeName)
Executes a getter (getX()) on the target object which returns Byte. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Byte> b(String attributeName)
Abbreviation for {attrOfByte(String)
.
attributeName
- the name of the attribute
public static Function<Object,Character> attrOfCharacter(String attributeName)
Executes a getter (getX()) on the target object which returns Character. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Character> c(String attributeName)
Abbreviation for {attrOfCharacter(String)
.
attributeName
- the name of the attribute
public static Function<Object,Calendar> attrOfCalendar(String attributeName)
Executes a getter (getX()) on the target object which returns Calendar. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Calendar> calendar(String attributeName)
Abbreviation for {attrOfCalendar(String)
.
attributeName
- the name of the attribute
public static Function<Object,Date> attrOfDate(String attributeName)
Executes a getter (getX()) on the target object which returns Date. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Date> date(String attributeName)
Abbreviation for {attrOfDate(String)
.
attributeName
- the name of the attribute
public static Function<Object,Double> attrOfDouble(String attributeName)
Executes a getter (getX()) on the target object which returns Double. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Double> d(String attributeName)
Abbreviation for {attrOfDouble(String)
.
attributeName
- the name of the attribute
public static Function<Object,Float> attrOfFloat(String attributeName)
Executes a getter (getX()) on the target object which returns Float. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Float> f(String attributeName)
Abbreviation for {attrOfFloat(String)
.
attributeName
- the name of the attribute
public static Function<Object,Integer> attrOfInteger(String attributeName)
Executes a getter (getX()) on the target object which returns Integer. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Integer> i(String attributeName)
Abbreviation for {attrOfInteger(String)
.
attributeName
- the name of the attribute
public static Function<Object,Long> attrOfLong(String attributeName)
Executes a getter (getX()) on the target object which returns Long. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Long> l(String attributeName)
Abbreviation for {attrOfLong(String)
.
attributeName
- the name of the attribute
public static Function<Object,Short> attrOfShort(String attributeName)
Executes a getter (getX()) on the target object which returns Short. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Short> shr(String attributeName)
Abbreviation for {attrOfShort(String)
.
attributeName
- the name of the attribute
public static Function<Object,String> attrOfString(String attributeName)
Executes a getter (getX()) on the target object which returns String. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,String> s(String attributeName)
Abbreviation for {attrOfString(String)
.
attributeName
- the name of the attribute
public static Function<Object,List<String>> attrOfListOfString(String attributeName)
Executes a getter (getX()) on the target object which returns List<String>. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,List<String>> listOfString(String attributeName)
Abbreviation for {attrOfListOfString(String)
.
attributeName
- the name of the attribute
public static Function<Object,Set<String>> attrOfSetOfString(String attributeName)
Executes a getter (getX()) on the target object which returns Set<String>. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,Set<String>> setOfString(String attributeName)
Abbreviation for {attrOfSetOfString(String)
.
attributeName
- the name of the attribute
public static Function<Object,String[]> attrOfArrayOfString(String attributeName)
Executes a getter (getX()) on the target object which returns String[]. If the specified attribute is, for example, "name", the called method will be "getName()".
attributeName
- the name of the attribute
public static Function<Object,String[]> arrayOfString(String attributeName)
Abbreviation for {attrOfArrayOfString(String)
.
attributeName
- the name of the attribute
public static <R> Function<Object,List<R>> attrOfListOf(org.javaruntype.type.Type<R> resultType, String attributeName)
Executes a getter (getX()) on the target object which returns List<R>, being R the specified type.
If the specified attribute is, for example, "name", the called method will be "getName()".
resultType
- the component type of the result list type.attributeName
- the name of the attribute
public static <R> Function<Object,List<R>> listOf(org.javaruntype.type.Type<R> resultType, String attributeName)
Abbreviation for {attrOfListOf(Type, String)
.
attributeName
- the name of the attribute
public static <R> Function<Object,Set<R>> attrOfSetOf(org.javaruntype.type.Type<R> resultType, String attributeName)
Executes a getter (getX()) on the target object which returns Set<R>, being R the specified type.
If the specified attribute is, for example, "name", the called method will be "getName()".
resultType
- the component type of the result set type.attributeName
- the name of the attribute
public static <R> Function<Object,Set<R>> setOf(org.javaruntype.type.Type<R> resultType, String attributeName)
Abbreviation for {attrOfSetOf(Type, String)
.
attributeName
- the name of the attribute
public static <R> Function<Object,R[]> attrOfArrayOf(org.javaruntype.type.Type<R> resultType, String attributeName)
Executes a getter (getX()) on the target object which returns R[], being R the specified type.
If the specified attribute is, for example, "name", the called method will be "getName()".
resultType
- the component type of the result array type.attributeName
- the name of the attribute
public static <R> Function<Object,R[]> arrayOf(org.javaruntype.type.Type<R> resultType, String attributeName)
Abbreviation for {attrOfArrayOf(Type, String)
.
attributeName
- the name of the attribute
public R execute(T input, ExecCtx ctx) throws Exception
IFunction
Executes the function on the current target object, which is passed
as the input parameter. The ExecCtx
parameter
provides some metadata related to the execution, like the index in
an iteration.
The execution of a function can throw any exception.
If you intend to call the execute method directly on any of
your functions (outside an op4j expression), you might prefer using
Function.execute(Object)
instead.
input
- the target object on which the function is to be executedctx
- the context (metadata) for the function execution
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |