Record Class ConfigFieldInfo
java.lang.Object
java.lang.Record
com.cloudforge.core.config.ConfigFieldInfo
- Record Components:
fieldName- the Java field namedisplayName- the user-friendly display namedescription- the field description for user helpcategory- the configuration category for groupingvisibleWhen- the visibility condition expressiondependsOn- the field this depends onrequired- whether the field is requiredexample- an example value for user guidanceallowedValues- array of allowed values (for constrained choices)min- the minimum value for numeric fieldsmax- the maximum value for numeric fieldspattern- the regex pattern for string validationdefaultFrom- the ApplicationSpec method to get default value frompropertyKey- optional application.properties key for defaultssensitive- whether this field contains sensitive datasourceConfig- the field containing the source location for sensitive data- the field tags for categorization and filteringvalidators- the custom validator class namesorder- the display order for sorting fieldstype- the Java type of the fieldfield- the reflected Field object
public record ConfigFieldInfo(String fieldName, String displayName, String description, String category, String visibleWhen, String dependsOn, boolean required, String example, String[] allowedValues, double min, double max, String pattern, String defaultFrom, String propertyKey, boolean sensitive, String sourceConfig, FieldTag[] tags, String[] validators, int order, Class<?> type, Field field)
extends Record
Runtime metadata for a configuration field discovered via introspection.
Encapsulates all information from ConfigField annotation plus
reflection metadata needed for prompting, validation, and value assignment.
- Since:
- 3.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionConfigFieldInfo(String fieldName, String displayName, String description, String category, String visibleWhen, String dependsOn, boolean required, String example, String[] allowedValues, double min, double max, String pattern, String defaultFrom, String propertyKey, boolean sensitive, String sourceConfig, FieldTag[] tags, String[] validators, int order, Class<?> type, Field field) Creates an instance of aConfigFieldInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionString[]Returns the value of theallowedValuesrecord component.category()Returns the value of thecategoryrecord component.Returns the value of thedefaultFromrecord component.Returns the value of thedependsOnrecord component.Returns the value of thedescriptionrecord component.Returns the value of thedisplayNamerecord component.final booleanIndicates whether some other object is "equal to" this one.example()Returns the value of theexamplerecord component.field()Returns the value of thefieldrecord component.Returns the value of thefieldNamerecord component.static ConfigFieldInfoCreates ConfigFieldInfo from a field with @ConfigField annotation.Gets the current value of this field from the config object.final inthashCode()Returns a hash code value for this object.booleanChecks if this field has a specific tag.booleanChecks if this field is visible based on the current configuration.doublemax()Returns the value of themaxrecord component.doublemin()Returns the value of theminrecord component.intorder()Returns the value of theorderrecord component.pattern()Returns the value of thepatternrecord component.Returns the value of thepropertyKeyrecord component.booleanrequired()Returns the value of therequiredrecord component.booleanReturns the value of thesensitiverecord component.voidSets the value of this field in the config object.Returns the value of thesourceConfigrecord component.tagList()Gets all tags as a list.FieldTag[]tags()Returns the value of thetagsrecord component.final StringtoString()Returns a string representation of this record class.Class<?> type()Returns the value of thetyperecord component.Validates the value according to field constraints and custom validators.String[]Returns the value of thevalidatorsrecord component.Returns the value of thevisibleWhenrecord component.
-
Constructor Details
-
ConfigFieldInfo
public ConfigFieldInfo(String fieldName, String displayName, String description, String category, String visibleWhen, String dependsOn, boolean required, String example, String[] allowedValues, double min, double max, String pattern, String defaultFrom, String propertyKey, boolean sensitive, String sourceConfig, FieldTag[] tags, String[] validators, int order, Class<?> type, Field field) Creates an instance of aConfigFieldInforecord class.- Parameters:
fieldName- the value for thefieldNamerecord componentdisplayName- the value for thedisplayNamerecord componentdescription- the value for thedescriptionrecord componentcategory- the value for thecategoryrecord componentvisibleWhen- the value for thevisibleWhenrecord componentdependsOn- the value for thedependsOnrecord componentrequired- the value for therequiredrecord componentexample- the value for theexamplerecord componentallowedValues- the value for theallowedValuesrecord componentmin- the value for theminrecord componentmax- the value for themaxrecord componentpattern- the value for thepatternrecord componentdefaultFrom- the value for thedefaultFromrecord componentpropertyKey- the value for thepropertyKeyrecord componentsensitive- the value for thesensitiverecord componentsourceConfig- the value for thesourceConfigrecord componenttags- the value for thetagsrecord componentvalidators- the value for thevalidatorsrecord componentorder- the value for theorderrecord componenttype- the value for thetyperecord componentfield- the value for thefieldrecord component
-
-
Method Details
-
from
Creates ConfigFieldInfo from a field with @ConfigField annotation. -
getValue
-
setValue
-
hasTag
Checks if this field has a specific tag. -
tagList
-
isVisible
-
validate
Validates the value according to field constraints and custom validators. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
fieldName
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
category
-
visibleWhen
Returns the value of thevisibleWhenrecord component.- Returns:
- the value of the
visibleWhenrecord component
-
dependsOn
-
required
-
example
-
allowedValues
Returns the value of theallowedValuesrecord component.- Returns:
- the value of the
allowedValuesrecord component
-
min
-
max
-
pattern
-
defaultFrom
Returns the value of thedefaultFromrecord component.- Returns:
- the value of the
defaultFromrecord component
-
propertyKey
Returns the value of thepropertyKeyrecord component.- Returns:
- the value of the
propertyKeyrecord component
-
sensitive
-
sourceConfig
Returns the value of thesourceConfigrecord component.- Returns:
- the value of the
sourceConfigrecord component
-
tags
-
validators
Returns the value of thevalidatorsrecord component.- Returns:
- the value of the
validatorsrecord component
-
order
-
type
-
field
-