Package org.apache.iceberg.common
Class DynClasses.Builder
java.lang.Object
org.apache.iceberg.common.DynClasses.Builder
- Enclosing class:
- DynClasses
-
Method Summary
Modifier and TypeMethodDescription<S> Class<? extends S>
build()
Returns the first implementation or throws RuntimeException if one was not found.<S> Class<? extends S>
Returns the first implementation or throws ClassNotFoundException if one was not found.Checks for an implementation of the class by name.loader
(ClassLoader newLoader) Set theClassLoader
used to lookup classes by name.orNull()
Instructs this builder to return null if no class is found, rather than throwing an Exception.
-
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
-
impl
Checks for an implementation of the class by name.- Parameters:
className
- name of a class- Returns:
- this Builder for method chaining
-
orNull
Instructs this builder to return null if no class is found, rather than throwing an Exception.- Returns:
- this Builder for method chaining
-
buildChecked
Returns the first implementation or throws ClassNotFoundException if one was not found.- Type Parameters:
S
- Java superclass- Returns:
- a
Class
for the first implementation found - Throws:
ClassNotFoundException
- if no implementation was found
-
build
Returns the first implementation or throws RuntimeException if one was not found.- Type Parameters:
S
- Java superclass- Returns:
- a
Class
for the first implementation found - Throws:
RuntimeException
- if no implementation was found
-