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,
Objects and nested ConfigFieldLists.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleans()Returns the value of thebooleansrecord component.doubles()Returns the value of thedoublesrecord component.final booleanIndicates whether some other object is "equal to" this one.floats()Returns the value of thefloatsrecord component.final inthashCode()Returns a hash code value for this object.integers()Returns the value of theintegersrecord component.Returns the value of thenestedFieldsrecord component.objects()Returns the value of theobjectsrecord component.parent()Returns the value of theparentrecord component.Returns the value of theparentFieldrecord component.static ConfigFieldListpopulateFields(@Nullable Field parentField, Object parent, IBrigadierConfigurator config) Generates aConfigFieldListfor selected object with recursion.final StringtoString()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 aConfigFieldListrecord class.- Parameters:
parentField- the value for theparentFieldrecord componentparent- the value for theparentrecord componentbooleans- the value for thebooleansrecord componentintegers- the value for theintegersrecord componentfloats- the value for thefloatsrecord componentdoubles- the value for thedoublesrecord componentobjects- the value for theobjectsrecord componentnestedFields- the value for thenestedFieldsrecord component
-
-
Method Details
-
populateFields
public static ConfigFieldList populateFields(@Nullable @Nullable Field parentField, Object parent, IBrigadierConfigurator config) Generates aConfigFieldListfor 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 generateConfigFieldListfor
-
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 theparentFieldrecord component.- Returns:
- the value of the
parentFieldrecord component
-
parent
Returns the value of theparentrecord component.- Returns:
- the value of the
parentrecord component
-
booleans
Returns the value of thebooleansrecord component.- Returns:
- the value of the
booleansrecord component
-
integers
Returns the value of theintegersrecord component.- Returns:
- the value of the
integersrecord component
-
floats
Returns the value of thefloatsrecord component.- Returns:
- the value of the
floatsrecord component
-
doubles
Returns the value of thedoublesrecord component.- Returns:
- the value of the
doublesrecord component
-
objects
Returns the value of theobjectsrecord component.- Returns:
- the value of the
objectsrecord component
-
nestedFields
Returns the value of thenestedFieldsrecord component.- Returns:
- the value of the
nestedFieldsrecord component
-