Package jodd.methref
Class Methref<C>
- java.lang.Object
-
- jodd.methref.Methref<C>
-
public class Methref<C> extends java.lang.Object
Super tool for getting method references (names) in compile-time.
-
-
Field Summary
Fields Modifier and Type Field Description static jodd.util.TypeCache<java.lang.Class>
cache
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isMyProxy(java.lang.Object instance)
Returnstrue
if given object is proxified by this Methref.<T> java.lang.String
lastName()
Returns name of last method invoked on proxy.static java.lang.String
lastName(java.lang.Object instance)
Returns method name of last invoked method on a proxy.void
lastName(java.lang.String name)
java.lang.String
name(java.util.function.Consumer<C> consumer)
Returns name of called method.static <T> Methref<T>
of(java.lang.Class<T> target)
Static factory, for convenient use.C
proxy()
Returns proxy instance that is ready to collect the method name of invoked methods.
-
-
-
Constructor Detail
-
Methref
public Methref(java.lang.Class<C> target)
Creates new proxified instance of target. Proxy classes are cached. If given target is also proxified, it's real target will be used.
-
-
Method Detail
-
of
public static <T> Methref<T> of(java.lang.Class<T> target)
Static factory, for convenient use.
-
name
public java.lang.String name(java.util.function.Consumer<C> consumer)
Returns name of called method.
-
proxy
public C proxy()
Returns proxy instance that is ready to collect the method name of invoked methods.
-
isMyProxy
public boolean isMyProxy(java.lang.Object instance)
Returnstrue
if given object is proxified by this Methref.
-
lastName
public static java.lang.String lastName(java.lang.Object instance)
Returns method name of last invoked method on a proxy.
-
lastName
public <T> java.lang.String lastName()
Returns name of last method invoked on proxy.
-
lastName
public void lastName(java.lang.String name)
-
-