public final class PropertyState
extends Object
The state for a single property in a ConfigurationDescriptor.
PropertyState is used in ConfigurationDesctiptors for 3 things:
LocalTypeDescriptors determines which fields appear in the UIvalue is the value for the corresponding PropertyDescriptorProperty state is a recursive data structure. The value can be a primitive when the type is a SystemType, a list when the type is a ListTypeDescriptor, or a Map of String to PropertyState when the TypeReference points to a LocalTypeDescriptor. The keys of this map correspond to the local type's property keys.
The type may not always reflect the corresponding PropertyDesctiptor's type. expressionable property descriptors may have a SystemType.EXPRESSION type during configuration. EncryptedTextPropertyDescriptor will have a SystemType.STRING type.
See the documentation for a PropertyDescriptor to know it's value's class
| Modifier and Type | Field and Description |
|---|---|
static String |
ERRORS_KEY |
static String |
TYPE_KEY |
static String |
VALUE_KEY |
| Modifier and Type | Method and Description |
|---|---|
PropertyState |
addErrors(Collection<String> errors)
Adds a collection of errors to the existing list of errors.
|
PropertyState |
addErrors(String... errors)
Adds a single error to the existing list of errors.
|
PropertyState |
clearErrors()
Clears all errors for this property state.
|
PropertyState |
clearErrorsAtPath(PropertyPath propertyPath)
Clears all errors for the property state at the given path.
|
boolean |
equals(Object o) |
List<String> |
getErrors()
Errors related to this property state.
|
List<String> |
getErrorsAtPath(PropertyPath path)
The property state's errors at a given
PropertyPath. |
PropertyState |
getPropertyStateAtPath(PropertyPath path)
The property state at a given path.
|
TypeReference |
getType()
The property state's type
|
TypeReference |
getTypeAtPath(PropertyPath path)
/**
The property state's type at a given
PropertyPath. |
Object |
getValue()
The property state's value
|
Object |
getValueAtPath(PropertyPath path)
The property state's value at a given
PropertyPath. |
int |
hashCode() |
boolean |
isExpression()
Whether the property state's type is
SystemType.EXPRESSION |
PropertyState |
setError(String error)
Clears all existing errors and adds the provided error to the empty list of errors.
|
PropertyState |
setErrorAtPath(PropertyPath path,
String error)
Clears all existing errors, replacing them with the given error.
|
PropertyState |
setErrors(Collection<String> errors)
Clears all existing errors and adds the provided errors to the empty list of errors.
|
PropertyState |
setErrorsAtPath(PropertyPath path,
List<String> errors)
Clears all existing errors, replacing them with the given errors.
|
PropertyState |
setType(LocalTypeDescriptor type)
The property state's type
|
PropertyState |
setType(SystemType type)
The property state's type
|
PropertyState |
setType(TypeReference type)
The property state's type
|
PropertyState |
setValue(Object value)
The property state's value
|
PropertyState |
setValueAtPath(PropertyPath path,
Object value)
The property state's value at a given path.
|
public static final String TYPE_KEY
public static final String VALUE_KEY
public static final String ERRORS_KEY
public TypeReference getType()
public TypeReference getTypeAtPath(PropertyPath path)
PropertyPath. This method can only be used when the type points to a LocalTypeDescriptor.path - The path to the nested PropertyStatepublic PropertyState setType(TypeReference type)
public PropertyState setType(SystemType type)
public PropertyState setType(LocalTypeDescriptor type)
public boolean isExpression()
SystemType.EXPRESSIONpublic Object getValue()
SystemType, a List, or a Map of String to PropertyState. Values can always be null.public Object getValueAtPath(PropertyPath path)
PropertyPath. This method can only be used when the type points to a LocalTypeDescriptor.path - The path to the nested PropertyStateSystemType, a List, or a Map of String to PropertyState. Values can always be null.public PropertyState setValue(Object value)
value - The value to set. This value can be a boxed primitive corresponding to a SystemType, a List, or a Map of String to PropertyState. Values can always be null.public PropertyState setValueAtPath(PropertyPath path, Object value)
type points to a LocalTypeDescriptor.path - The path to the nested PropertyStatevalue - The value to set. This value can be a boxed primitive corresponding to a SystemType, a List, or a Map of String to PropertyState. Values can always be null.public PropertyState getPropertyStateAtPath(PropertyPath path)
type points to a LocalTypeDescriptor.path - The path to the nested PropertyStatepublic List<String> getErrors()
Errors function as warnings to the user that their current configuration is invalid in some way. The error message will appear in close proximity to the field that the state corresponds to. If the state does not match a PropertyDescriptor in the ConfigurationDescriptor.getTypes(), the error will be ignored.
Errors do not prevent the user from saving a configuration, executing an integration, or testing a connected system.
public List<String> getErrorsAtPath(PropertyPath path)
PropertyPath. This method can only be used when the type points to a LocalTypeDescriptor.
Errors function as warnings to the user that their current configuration is invalid in some way. The error message will appear in close proximity to the field that the state corresponds to. If the state does not match a PropertyDescriptor in the ConfigurationDescriptor.getTypes(), the error will be ignored.
Errors do not prevent the user from saving a configuration, executing an integration, or testing a connected system.
path - The path to the nested PropertyStatepublic PropertyState addErrors(String... errors)
See also: getErrors()
public PropertyState addErrors(Collection<String> errors)
See also: getErrors()
public PropertyState setError(String error)
See also: getErrors()
public PropertyState setErrorAtPath(PropertyPath path, String error)
type points to a LocalTypeDescriptor.
See also: getErrors()
path - The path to the nested PropertyStateerror - The error to setpublic PropertyState setErrorsAtPath(PropertyPath path, List<String> errors)
type points to a LocalTypeDescriptor.
See also: getErrors()
path - The path to the nested PropertyStateerrors - The errors to setpublic PropertyState setErrors(Collection<String> errors)
See also: getErrors()
public PropertyState clearErrors()
See also: getErrors()
public PropertyState clearErrorsAtPath(PropertyPath propertyPath)
type points to a LocalTypeDescriptor.
See also: getErrors()
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class ObjectCopyright © 2018-present Appian Corporation. All Rights Reserved.