Class ObjectBinder

java.lang.Object
com.electronwill.nightconfig.core.conversion.ObjectBinder

public final class ObjectBinder extends Object
Creates configurations bound to an object or class, getting its values from its fields.
  • Constructor Details

    • ObjectBinder

      public ObjectBinder(boolean bypassTransient, boolean bypassFinal)
      Creates a new ObjectBinder with advanced parameters.
      Parameters:
      bypassTransient - true to use (parse or write) a field even if it's transient
      bypassFinal - true to write a field even if it's final
    • ObjectBinder

      public ObjectBinder()
      Creates a new ObjectBinder with the default parameters. This is equivalent to new ObjectBinder(false, true).
      See Also:
  • Method Details

    • bind

      public Config bind(Class<?> clazz)
      Creates a new config bound to the static fields of a class.
      Parameters:
      clazz - the class to bind
      Returns:
      a config bound to the static fields of the class
    • bind

      public Config bind(Class<?> clazz, ConfigFormat<?> configFormat)
      Creates a new config bound to the static fields of a class.
      Parameters:
      clazz - the class to bind
      configFormat - the Config format
      Returns:
      a config bound to the static fields of the class
    • bind

      public Config bind(Object object)
      Creates a new config bound to the fields of a object.
      Parameters:
      object - the class to bind
      Returns:
      a config bound to the fields of the object
    • bind

      public Config bind(Object object, ConfigFormat<?> configFormat)
      Creates a new config bound to the fields of a object.
      Parameters:
      object - the class to bind
      configFormat - the Config format
      Returns:
      a config bound to the fields of the object