Class ConfigField

java.lang.Object
redempt.redlib.config.ConfigField

public class ConfigField extends Object
Wraps a Field and stores the name which should be used to store its value in config
  • Constructor Details

    • ConfigField

      public ConfigField(Field field)
      Constructs a ConfigField from a field
      Parameters:
      field - The Field
  • Method Details

    • getField

      public Field getField()
      Returns:
      The wrapped Field
    • set

      public void set(Object target, Object value)
      Attemps to set the value of the field for the target object to the value
      Parameters:
      target - The target object
      value - The value
    • set

      public void set(Object value)
      Attemps to set the field in a static context to the given value
      Parameters:
      value - The value
    • get

      public Object get(Object target)
      Attempts to get the field's value for a given object
      Parameters:
      target - The target object to get the value from
      Returns:
      The value
    • get

      public Object get()
      Attemps to get the value of the field in a static context
      Returns:
      The value
    • getName

      public String getName()
      Returns:
      The name for the field that should be used to store config values
    • getComments

      public List<String> getComments()
      Returns:
      Comments which should be applied to the path in config
    • setComments

      public void setComments(List<String> comments)
      Sets the comments which should be applied to the path in config
      Parameters:
      comments - The comments which should be applied
    • setName

      public void setName(String name)
      Sets the name of this ConfigField
      Parameters:
      name - The name to set
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object