Class DefaultBinder

java.lang.Object
tech.guilhermekaua.spigotboot.config.binding.DefaultBinder
All Implemented Interfaces:
Binder

public class DefaultBinder extends Object implements Binder
Default implementation of the Binder interface.
  • Method Details

    • bind

      @NotNull public <T> @NotNull BindingResult<T> bind(@NotNull @NotNull ConfigNode node, @NotNull @NotNull Class<T> type, @NotNull @NotNull NamingStrategy namingStrategy)
      Description copied from interface: Binder
      Binds a config node to a new instance of the target type.
      Specified by:
      bind in interface Binder
      Type Parameters:
      T - the type parameter
      Parameters:
      node - the source node
      type - the target type
      namingStrategy - the naming strategy for field to config key conversion
      Returns:
      the binding result
    • bind

      @NotNull public <T> @NotNull BindingResult<T> bind(@NotNull @NotNull ConfigNode node, @NotNull T instance, @NotNull @NotNull NamingStrategy namingStrategy)
      Description copied from interface: Binder
      Binds config values onto an existing instance (field injection only).
      Specified by:
      bind in interface Binder
      Type Parameters:
      T - the type parameter
      Parameters:
      node - the source node
      instance - the target instance
      namingStrategy - the naming strategy for field to config key conversion
      Returns:
      the binding result
    • unbind

      public <T> void unbind(@NotNull T object, @NotNull @NotNull MutableConfigNode node, @NotNull @NotNull NamingStrategy namingStrategy)
      Description copied from interface: Binder
      Serializes an object to a config node.
      Specified by:
      unbind in interface Binder
      Type Parameters:
      T - the type parameter
      Parameters:
      object - the object to serialize
      node - the target node
      namingStrategy - the naming strategy for field to config key conversion