Interface IPropertyAdapter<T extends IConfigProperty<?>>

Type Parameters:
T - The type of config property to map values into.
All Known Implementing Classes:
CodecProperty.Adapter

public interface IPropertyAdapter<T extends IConfigProperty<?>>
Property adapters are used to map Java fields to config properties.
  • Method Summary

    Modifier and Type
    Method
    Description
    toValue(PropertyResolver resolver, Field field, Object parent, @Nullable Object value, Value valueMeta)
    Attempts to map a field on the config object to a config property.
  • Method Details

    • toValue

      @Nullable T toValue(PropertyResolver resolver, Field field, Object parent, @Nullable @Nullable Object value, Value valueMeta) throws IOException
      Attempts to map a field on the config object to a config property. If the field is not adaptable null should be returned.
      Parameters:
      resolver - Resolves other config properties and JSON values using the options provided when the ConfigManager is built.
      field - The field being mapped.
      parent - The parent object that holds the field.
      value - The current value of the field.
      valueMeta - Metadata related to the config value.
      Returns:
      If the field can be mapped to a property it will be returned, otherwise null.
      Throws:
      IOException - Errors may occur when trying to map the field to a property.