Record Class ConfigFieldList
java.lang.Object
java.lang.Record
org.samo_lego.config2brigadier.common.util.ConfigFieldList
public record ConfigFieldList(Field parentField, @Nullable Object parent, List<Field> booleans, List<Field> integers, List<Field> floats, List<Field> doubles, List<Field> maps, List<Field> lists, List<Field> sets, List<Field> objects, List<ConfigFieldList> nestedFields)
extends Record
Creates an object containing lists with primitives,
Objects and nested ConfigFieldLists.-
Constructor Summary
ConstructorsConstructorDescriptionConfigFieldList(Field parentField, @Nullable Object parent, List<Field> booleans, List<Field> integers, List<Field> floats, List<Field> doubles, List<Field> maps, List<Field> lists, List<Field> sets, List<Field> objects, List<ConfigFieldList> nestedFields) Creates an instance of aConfigFieldListrecord class. -
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.lists()Returns the value of thelistsrecord component.maps()Returns the value of themapsrecord component.Returns the value of thenestedFieldsrecord component.objects()Returns the value of theobjectsrecord component.@Nullable Objectparent()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.sets()Returns the value of thesetsrecord component.static ConfigFieldListtemplate(@Nullable Field parentField, Class<?> clazz, IBrigadierConfigurator config) Generates aConfigFieldListtemplate for selected class with recursion.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ConfigFieldList
public ConfigFieldList(Field parentField, @Nullable @Nullable Object parent, List<Field> booleans, List<Field> integers, List<Field> floats, List<Field> doubles, List<Field> maps, List<Field> lists, List<Field> sets, 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 componentmaps- the value for themapsrecord componentlists- the value for thelistsrecord componentsets- the value for thesetsrecord 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
-
template
public static ConfigFieldList template(@Nullable @Nullable Field parentField, Class<?> clazz, IBrigadierConfigurator config) Generates aConfigFieldListtemplate for selected class with recursion.- Parameters:
parentField- field that holds this classclazz- class to generate template forconfig- configurator- Returns:
- template
-
toString
-
hashCode
-
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
-
integers
-
floats
-
doubles
-
maps
-
lists
-
sets
-
objects
-
nestedFields
Returns the value of thenestedFieldsrecord component.- Returns:
- the value of the
nestedFieldsrecord component
-