T - public interface PropertyGetter<T>
class Bean {
TheType beanProp;
public TheType getBeanProp() {
return beanProp;
}
}
PropertyGetter<Bean> pg = ...;
//name="beanProp"
String name = pg.getName(b -> b.getBeanProp());
//clz = TheType.class, even if beanProp's actual type is subclass of TheType
Class<?> clz = pg.getType(b -> b.getBeanProp());
| 限定符和类型 | 方法和说明 |
|---|---|
String |
getName(java.util.function.Function<T,?> invoke)
Get name of property related in the invocation.
|
Class<?> |
getType(java.util.function.Function<T,?> invoke)
Get type of property related in the invocation.
|
default String |
nameOf(java.util.function.Function<T,?> invoke)
More readable version of
getName(Function). |
default boolean |
supportFieldInvoke()
Whether the direct field invoke is supported.
|
default Class<?> |
typeOf(java.util.function.Function<T,?> invoke)
More readable version of
getType(Function). |
String getName(java.util.function.Function<T,?> invoke)
invoke - Class<?> getType(java.util.function.Function<T,?> invoke)
invoke - default String nameOf(java.util.function.Function<T,?> invoke)
getName(Function).invoke - default Class<?> typeOf(java.util.function.Function<T,?> invoke)
getType(Function).invoke - default boolean supportFieldInvoke()
PropertyGetter pg = ...;
pg.getName(b -> b.beanProp);
Copyright © 2018. All rights reserved.