@LimitedPrivate("testing")
@Unstable
public final class BindingUtils
extends java.lang.Object
org.apache.parquet.hadoop.util.wrapped.io.BindingUtils.| Modifier and Type | Method | Description |
|---|---|---|
static boolean |
available(DynMethods.UnboundMethod method) |
Is a method available?
|
static void |
checkAvailable(DynMethods.UnboundMethod method) |
Require a method to be available.
|
static <T> T |
extractIOEs(java.util.function.Supplier<T> call) |
Invoke the supplier, catching any
UncheckedIOException raised,
extracting the inner IOException and rethrowing it. |
static boolean |
implemented(DynMethods.UnboundMethod... methods) |
Given a sequence of methods, verify that they are all available.
|
static java.lang.Class<?> |
loadClass(java.lang.ClassLoader cl,
java.lang.String className) |
Load a class by name.
|
static java.lang.Class<?> |
loadClass(java.lang.String className) |
Load a class by name.
|
static java.lang.Class<?> |
loadClassSafely(java.lang.String className) |
Load a class by name.
|
static <T> DynMethods.UnboundMethod |
loadInvocation(java.lang.Class<?> source,
java.lang.Class<? extends T> returnType,
java.lang.String name,
java.lang.Class<?>... parameterTypes) |
Get an invocation from the source class, which will be unavailable() if
the class is null or the method isn't found.
|
static <T> DynMethods.UnboundMethod |
loadStaticMethod(java.lang.Class<?> source,
java.lang.Class<? extends T> returnType,
java.lang.String name,
java.lang.Class<?>... parameterTypes) |
Load a static method from the source class, which will be a noop() if
the class is null or the method isn't found.
|
static DynMethods.UnboundMethod |
noop(java.lang.String name) |
Create a no-op method.
|
public static java.lang.Class<?> loadClass(java.lang.String className)
className - classnamepublic static java.lang.Class<?> loadClassSafely(java.lang.String className)
className - classnamejava.lang.RuntimeException - if the class was not found.public static java.lang.Class<?> loadClass(java.lang.ClassLoader cl,
java.lang.String className)
cl - classloader to use.className - classnamepublic static <T> DynMethods.UnboundMethod loadInvocation(java.lang.Class<?> source, java.lang.Class<? extends T> returnType, java.lang.String name, java.lang.Class<?>... parameterTypes)
T - return typesource - source. If null, the method is a no-op.returnType - return type class (unused)name - method nameparameterTypes - parameterspublic static <T> DynMethods.UnboundMethod loadStaticMethod(java.lang.Class<?> source, java.lang.Class<? extends T> returnType, java.lang.String name, java.lang.Class<?>... parameterTypes)
IllegalStateException
is raised on the basis that this means that the binding class is broken,
rather than missing/out of date.T - return typesource - source. If null, the method is a no-op.returnType - return type class (unused)name - method nameparameterTypes - parametersjava.lang.IllegalStateException - if the method is not static.public static DynMethods.UnboundMethod noop(java.lang.String name)
name - method namepublic static boolean implemented(DynMethods.UnboundMethod... methods)
methods - methodspublic static void checkAvailable(DynMethods.UnboundMethod method) throws java.lang.UnsupportedOperationException
method - method to probejava.lang.UnsupportedOperationException - if the method was not found.public static boolean available(DynMethods.UnboundMethod method)
method - method to probepublic static <T> T extractIOEs(java.util.function.Supplier<T> call)
throws java.io.IOException
UncheckedIOException raised,
extracting the inner IOException and rethrowing it.T - type of resultcall - call to invokejava.io.IOException - if the call raised an IOException wrapped by an UncheckedIOException.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.