Package org.apache.iceberg.common
Class DynMethods.Builder
java.lang.Object
org.apache.iceberg.common.DynMethods.Builder
- Enclosing class:
- DynMethods
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Returns the first valid implementation as a UnboundMethod or throws a RuntimeError if there is none.Returns the first valid implementation as a BoundMethod or throws a RuntimeError if there is none.Returns the first valid implementation as a UnboundMethod or throws a NoSuchMethodException if there is none.buildChecked
(Object receiver) Returns the first valid implementation as a BoundMethod or throws a NoSuchMethodException if there is none.Returns the first valid implementation as a StaticMethod or throws a RuntimeException if there is none.Returns the first valid implementation as a StaticMethod or throws a NoSuchMethodException if there is none.Deprecated.since 1.6.0, will be removed in 1.7.0Deprecated.since 1.6.0, will be removed in 1.7.0hiddenImpl
(Class<?> targetClass, Class<?>... argClasses) Checks for a method implementation.hiddenImpl
(Class<?> targetClass, String methodName, Class<?>... argClasses) Checks for a method implementation.hiddenImpl
(String className, Class<?>... argClasses) Checks for an implementation, first finding the given class by name.hiddenImpl
(String className, String methodName, Class<?>... argClasses) Checks for an implementation, first finding the given class by name.Checks for a method implementation.Checks for a method implementation.Checks for an implementation, first finding the given class by name.Checks for an implementation, first finding the given class by name.loader
(ClassLoader newLoader) Set theClassLoader
used to lookup classes by name.orNoop()
If no implementation has been found, adds a NOOP method.
-
Constructor Details
-
Builder
-
-
Method Details
-
loader
Set theClassLoader
used to lookup classes by name.If not set, the current thread's ClassLoader is used.
- Parameters:
newLoader
- a ClassLoader- Returns:
- this Builder for method chaining
-
orNoop
If no implementation has been found, adds a NOOP method.Note: calls to impl will not match after this method is called!
- Returns:
- this Builder for method chaining
-
impl
Checks for an implementation, first finding the given class by name.- Parameters:
className
- name of a classmethodName
- name of a method (different from constructor)argClasses
- argument classes for the method- Returns:
- this Builder for method chaining
- See Also:
-
impl
Checks for an implementation, first finding the given class by name.The name passed to the constructor is the method name used.
- Parameters:
className
- name of a classargClasses
- argument classes for the method- Returns:
- this Builder for method chaining
- See Also:
-
impl
Checks for a method implementation.- Parameters:
targetClass
- a class instancemethodName
- name of a method (different from constructor)argClasses
- argument classes for the method- Returns:
- this Builder for method chaining
- See Also:
-
impl
Checks for a method implementation.The name passed to the constructor is the method name used.
- Parameters:
targetClass
- a class instanceargClasses
- argument classes for the method- Returns:
- this Builder for method chaining
- See Also:
-
ctorImpl
Deprecated.since 1.6.0, will be removed in 1.7.0 -
ctorImpl
Deprecated.since 1.6.0, will be removed in 1.7.0 -
build
Returns the first valid implementation as a UnboundMethod or throws a RuntimeError if there is none.- Returns:
- a
DynMethods.UnboundMethod
with a valid implementation - Throws:
RuntimeException
- if no implementation was found
-
build
Returns the first valid implementation as a BoundMethod or throws a RuntimeError if there is none.- Parameters:
receiver
- an Object to receive the method invocation- Returns:
- a
DynMethods.BoundMethod
with a valid implementation and receiver - Throws:
IllegalStateException
- if the method is staticIllegalArgumentException
- if the receiver's class is incompatibleRuntimeException
- if no implementation was found
-
buildChecked
Returns the first valid implementation as a UnboundMethod or throws a NoSuchMethodException if there is none.- Returns:
- a
DynMethods.UnboundMethod
with a valid implementation - Throws:
NoSuchMethodException
- if no implementation was found
-
buildChecked
Returns the first valid implementation as a BoundMethod or throws a NoSuchMethodException if there is none.- Parameters:
receiver
- an Object to receive the method invocation- Returns:
- a
DynMethods.BoundMethod
with a valid implementation and receiver - Throws:
IllegalStateException
- if the method is staticIllegalArgumentException
- if the receiver's class is incompatibleNoSuchMethodException
- if no implementation was found
-
buildStaticChecked
Returns the first valid implementation as a StaticMethod or throws a NoSuchMethodException if there is none.- Returns:
- a
DynMethods.StaticMethod
with a valid implementation - Throws:
IllegalStateException
- if the method is not staticNoSuchMethodException
- if no implementation was found
-
buildStatic
Returns the first valid implementation as a StaticMethod or throws a RuntimeException if there is none.- Returns:
- a
DynMethods.StaticMethod
with a valid implementation - Throws:
IllegalStateException
- if the method is not staticRuntimeException
- if no implementation was found
-