Package ftbsc.lll.proxies.impl
Class MethodProxy.Builder
- java.lang.Object
-
- ftbsc.lll.proxies.AbstractProxy.Builder<MethodProxy>
-
- ftbsc.lll.proxies.impl.MethodProxy.Builder
-
- Enclosing class:
- MethodProxy
public static class MethodProxy.Builder extends AbstractProxy.Builder<MethodProxy>
A builder object forMethodProxy
.
-
-
Field Summary
-
Fields inherited from class ftbsc.lll.proxies.AbstractProxy.Builder
descriptor, modifiers, name, parent
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodProxy.Builder
addParameter(java.lang.Class<?> paramType)
Adds a parameter of a given type.MethodProxy.Builder
addParameter(java.lang.String fqn, int arrayLevel)
Adds a parameter of a given type.MethodProxy
build()
Builds aMethodProxy
of the given kind.MethodProxy.Builder
setDescriptor(java.lang.String descr)
Sets the type of the method to the given descriptor, and extracts return and parameter types from it.MethodProxy.Builder
setParent(java.lang.String parentFQN)
Sets the parent class of this method to the one described by the fully qualified name.MethodProxy.Builder
setParent(java.lang.String parentFQN, int modifiers)
Sets the parent class of this method to the one described by the fully qualified name and with the given modifiers.MethodProxy.Builder
setReturnType(java.lang.Class<?> returnType)
Sets the return type to the given type.MethodProxy.Builder
setReturnType(java.lang.String fqn, int arrayLevel)
Sets the return type to the given type.-
Methods inherited from class ftbsc.lll.proxies.AbstractProxy.Builder
addModifier, setModifiers, setParent, setType
-
-
-
-
Method Detail
-
addParameter
public MethodProxy.Builder addParameter(java.lang.String fqn, int arrayLevel)
Adds a parameter of a given type.- Parameters:
fqn
- the fully qualified name of the parameter typearrayLevel
- the array level of the parameter type- Returns:
- the builder's state after the change
-
addParameter
public MethodProxy.Builder addParameter(java.lang.Class<?> paramType)
Adds a parameter of a given type.- Parameters:
paramType
- theClass
object corresponding to the parameter type.- Returns:
- the builder's state after the change
-
setReturnType
public MethodProxy.Builder setReturnType(java.lang.String fqn, int arrayLevel)
Sets the return type to the given type.- Parameters:
fqn
- the fully qualified name of the return typearrayLevel
- the array level of the return type- Returns:
- the builder's state after the change
-
setParent
public MethodProxy.Builder setParent(java.lang.String parentFQN, int modifiers)
Sets the parent class of this method to the one described by the fully qualified name and with the given modifiers.- Parameters:
parentFQN
- the fully qualified name of the parentmodifiers
- the modifiers of the parent- Returns:
- the builder's state after the change
-
setParent
public MethodProxy.Builder setParent(java.lang.String parentFQN)
Sets the parent class of this method to the one described by the fully qualified name.- Parameters:
parentFQN
- the fully qualified name of the parent- Returns:
- the builder's state after the change
-
setReturnType
public MethodProxy.Builder setReturnType(java.lang.Class<?> returnType)
Sets the return type to the given type.- Parameters:
returnType
- theClass
object corresponding to the return type- Returns:
- the builder's state after the change
-
setDescriptor
public MethodProxy.Builder setDescriptor(java.lang.String descr)
Sets the type of the method to the given descriptor, and extracts return and parameter types from it.- Overrides:
setDescriptor
in classAbstractProxy.Builder<MethodProxy>
- Parameters:
descr
- the descriptor- Returns:
- the builder's state after the change
-
build
public MethodProxy build()
Builds aMethodProxy
of the given kind.- Specified by:
build
in classAbstractProxy.Builder<MethodProxy>
- Returns:
- the built
MethodProxy
-
-