Record Class ConfigFieldList
java.lang.Object
java.lang.Record
org.samo_lego.config2brigadier.common.util.ConfigFieldList
public record ConfigFieldList(Field parentField, Object parent, List<Field> booleans, List<Field> integers, List<Field> floats, List<Field> doubles, List<Field> objects, List<ConfigFieldList> nestedFields)
extends Record
Creates an object containing lists with primitives,
Object
s and nested ConfigFieldList
s.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleans()
Returns the value of thebooleans
record component.doubles()
Returns the value of thedoubles
record component.final boolean
Indicates whether some other object is "equal to" this one.floats()
Returns the value of thefloats
record component.final int
hashCode()
Returns a hash code value for this object.integers()
Returns the value of theintegers
record component.Returns the value of thenestedFields
record component.objects()
Returns the value of theobjects
record component.parent()
Returns the value of theparent
record component.Returns the value of theparentField
record component.static ConfigFieldList
populateFields
(@Nullable Field parentField, Object parent, IBrigadierConfigurator config) Generates aConfigFieldList
for selected object with recursion.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
ConfigFieldList
public ConfigFieldList(Field parentField, Object parent, List<Field> booleans, List<Field> integers, List<Field> floats, List<Field> doubles, List<Field> objects, List<ConfigFieldList> nestedFields) Creates an instance of aConfigFieldList
record class.- Parameters:
parentField
- the value for theparentField
record componentparent
- the value for theparent
record componentbooleans
- the value for thebooleans
record componentintegers
- the value for theintegers
record componentfloats
- the value for thefloats
record componentdoubles
- the value for thedoubles
record componentobjects
- the value for theobjects
record componentnestedFields
- the value for thenestedFields
record component
-
-
Method Details
-
populateFields
public static ConfigFieldList populateFields(@Nullable @Nullable Field parentField, Object parent, IBrigadierConfigurator config) Generates aConfigFieldList
for selected object with recursion. Supports nested values as well.- Parameters:
parentField
- - field whose name will be used for the command node. If null, it will default to "edit", as the only config object that doesn't have a field is object itself, as it's a class.parent
- - object to generateConfigFieldList
for
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
parentField
Returns the value of theparentField
record component.- Returns:
- the value of the
parentField
record component
-
parent
Returns the value of theparent
record component.- Returns:
- the value of the
parent
record component
-
booleans
Returns the value of thebooleans
record component.- Returns:
- the value of the
booleans
record component
-
integers
Returns the value of theintegers
record component.- Returns:
- the value of the
integers
record component
-
floats
Returns the value of thefloats
record component.- Returns:
- the value of the
floats
record component
-
doubles
Returns the value of thedoubles
record component.- Returns:
- the value of the
doubles
record component
-
objects
Returns the value of theobjects
record component.- Returns:
- the value of the
objects
record component
-
nestedFields
Returns the value of thenestedFields
record component.- Returns:
- the value of the
nestedFields
record component
-