Class Class.Builder<B extends Class.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Class

public static class Class.Builder<B extends Class.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Class build()
      Finish building the Class object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Class.
      Overrides:
      build in class GObject.Builder<B extends Class.Builder<B>>
      Returns:
      a new instance of Class with the properties that were set in the Builder object.
    • setContext

      public B setContext(Context context)
      The JSCContext in which the class was registered.
      Parameters:
      context - the value for the context property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setName

      public B setName(String name)
      The name of the class.
      Parameters:
      name - the value for the name property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setParent

      public B setParent(Class parent)
      The parent class or null in case of final classes.
      Parameters:
      parent - the value for the parent property
      Returns:
      the Builder instance is returned, to allow method chaining