Class DynClasses.Builder

java.lang.Object
org.apache.iceberg.common.DynClasses.Builder
Enclosing class:
DynClasses

public static class DynClasses.Builder extends Object
  • Method Details

    • loader

      public DynClasses.Builder loader(ClassLoader newLoader)
      Set the ClassLoader 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

      public DynClasses.Builder impl(String className)
      Checks for an implementation of the class by name.
      Parameters:
      className - name of a class
      Returns:
      this Builder for method chaining
    • orNull

      public DynClasses.Builder orNull()
      Instructs this builder to return null if no class is found, rather than throwing an Exception.
      Returns:
      this Builder for method chaining
    • buildChecked

      public <S> Class<? extends S> buildChecked() throws ClassNotFoundException
      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

      public <S> Class<? extends S> 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