Package com.cloudforge.core.config
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 fromsensitive- 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, 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, 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.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, 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 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
Gets the current value of this field from the config object. -
setValue
Sets the value of this field in the config object. -
hasTag
Checks if this field has a specific tag. -
tagList
Gets all tags as a list. -
isVisible
Checks if this field is visible based on the current configuration.- Parameters:
appSpec- the application spec (may be null)config- the deployment config object- Returns:
- true if the field should be visible, false otherwise
-
validate
Validates the value according to field constraints and custom validators. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
fieldName
Returns the value of thefieldNamerecord component.- Returns:
- the value of the
fieldNamerecord component
-
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
Returns the value of thecategoryrecord component.- Returns:
- the value of the
categoryrecord component
-
visibleWhen
Returns the value of thevisibleWhenrecord component.- Returns:
- the value of the
visibleWhenrecord component
-
dependsOn
Returns the value of thedependsOnrecord component.- Returns:
- the value of the
dependsOnrecord component
-
required
public boolean required()Returns the value of therequiredrecord component.- Returns:
- the value of the
requiredrecord component
-
example
Returns the value of theexamplerecord component.- Returns:
- the value of the
examplerecord component
-
allowedValues
Returns the value of theallowedValuesrecord component.- Returns:
- the value of the
allowedValuesrecord component
-
min
public double min()Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
public double max()Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
pattern
Returns the value of thepatternrecord component.- Returns:
- the value of the
patternrecord component
-
defaultFrom
Returns the value of thedefaultFromrecord component.- Returns:
- the value of the
defaultFromrecord component
-
sensitive
public boolean sensitive()Returns the value of thesensitiverecord component.- Returns:
- the value of the
sensitiverecord component
-
sourceConfig
Returns the value of thesourceConfigrecord component.- Returns:
- the value of the
sourceConfigrecord component
-
tags
Returns the value of thetagsrecord component.- Returns:
- the value of the
tagsrecord component
-
validators
Returns the value of thevalidatorsrecord component.- Returns:
- the value of the
validatorsrecord component
-
order
public int order()Returns the value of theorderrecord component.- Returns:
- the value of the
orderrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
field
Returns the value of thefieldrecord component.- Returns:
- the value of the
fieldrecord component
-