Package redempt.redlib.config
Class ConfigField
java.lang.Object
redempt.redlib.config.ConfigField
Wraps a Field and stores the name which should be used to store its value in config
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanget()Attemps to get the value of the field in a static contextAttempts to get the field's value for a given objectgetField()getName()inthashCode()voidAttemps to set the field in a static context to the given valuevoidAttemps to set the value of the field for the target object to the valuevoidsetComments(List<String> comments) Sets the comments which should be applied to the path in configvoidSets the name of this ConfigField
-
Constructor Details
-
ConfigField
Constructs a ConfigField from a field- Parameters:
field- The Field
-
-
Method Details
-
getField
- Returns:
- The wrapped Field
-
set
Attemps to set the value of the field for the target object to the value- Parameters:
target- The target objectvalue- The value
-
set
Attemps to set the field in a static context to the given value- Parameters:
value- The value
-
get
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
Attemps to get the value of the field in a static context- Returns:
- The value
-
getName
- Returns:
- The name for the field that should be used to store config values
-
getComments
- Returns:
- Comments which should be applied to the path in config
-
setComments
Sets the comments which should be applied to the path in config- Parameters:
comments- The comments which should be applied
-
setName
Sets the name of this ConfigField- Parameters:
name- The name to set
-
hashCode
public int hashCode() -
equals
-