Class ConfigCondition
- java.lang.Object
- 
- com.inductiveautomation.perspective.common.ConfigCondition
 
- 
 public class ConfigCondition extends java.lang.ObjectConvenience class for ensuring that a json object structure has expected members in it.
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ConfigConditionofObject(com.inductiveautomation.ignition.common.gson.JsonElement object)ConfigConditionoptional(java.lang.String name, java.util.function.Predicate<com.inductiveautomation.ignition.common.gson.JsonElement> predicate, java.util.function.Function<com.inductiveautomation.ignition.common.gson.JsonElement,java.lang.String> errorMessage)General purpose optional-check.ConfigConditionoptionalArray(java.lang.String name)Checks to see if a member with the given name exists.ConfigConditionoptionalBoolean(java.lang.String name)Checks to see if a member with the given name exists.<E extends java.lang.Enum>
 ConfigConditionoptionalEnum(java.lang.String name, java.lang.Class<E> enumClass)Case-sensitive enum comparison<E extends java.lang.Enum>
 ConfigConditionoptionalEnum(java.lang.String name, java.lang.Class<E> enumClass, boolean ignoreCase)ConfigConditionoptionalObject(java.lang.String name)Checks to see if a member with the given name exists.ConfigConditionoptionalOneOf(java.lang.String name, JsonType... types)Checks to see if a member with the given name exists.ConfigConditionoptionalString(java.lang.String name)Checks to see if a member with the given name exists.ConfigConditionrequireNonBlankString(java.lang.String name)Requires that the property at the given path is a string that is not blank.ConfigConditionrequireObject(java.lang.String name)Requires that the property at the given path is an object.ConfigConditionrequireOneOf(java.lang.String name, JsonType... types)Requires that the property at the given path is one of the providedJsonTypes.ConfigConditionrequireString(java.lang.String name)Requires that the property at the given path is a string.
 
- 
- 
- 
Method Detail- 
ofObjectpublic static ConfigCondition ofObject(com.inductiveautomation.ignition.common.gson.JsonElement object) throws ConfigurationException - Throws:
- ConfigurationException
 
 - 
optionalOneOfpublic ConfigCondition optionalOneOf(java.lang.String name, @Nonnull JsonType... types) throws ConfigurationException Checks to see if a member with the given name exists. If it does, ensures that it is one of the providedJsonTypes- Throws:
- ConfigurationException
 
 - 
requireOneOfpublic ConfigCondition requireOneOf(java.lang.String name, @Nonnull JsonType... types) throws ConfigurationException Requires that the property at the given path is one of the providedJsonTypes. Does not accept null, missing, or otherwise mis-typed.- Throws:
- ConfigurationException
 
 - 
requireObjectpublic ConfigCondition requireObject(java.lang.String name) throws ConfigurationException Requires that the property at the given path is an object. Does not accept null, missing, or otherwise mis-typed.- Throws:
- ConfigurationException
 
 - 
requireStringpublic ConfigCondition requireString(java.lang.String name) throws ConfigurationException Requires that the property at the given path is a string. Accepts empty string, but not null, missing, or otherwise mis-typed.- Throws:
- ConfigurationException
 
 - 
requireNonBlankStringpublic ConfigCondition requireNonBlankString(java.lang.String name) throws ConfigurationException Requires that the property at the given path is a string that is not blank. Accepts empty string, but not null, missing, or otherwis mis-typed.- Throws:
- ConfigurationException
- See Also:
- StringUtils.isNotBlank(CharSequence)
 
 - 
optionalEnumpublic <E extends java.lang.Enum> ConfigCondition optionalEnum(java.lang.String name, java.lang.Class<E> enumClass) throws ConfigurationException Case-sensitive enum comparison- Throws:
- ConfigurationException
- See Also:
- optionalEnum(String, Class, boolean)
 
 - 
optionalEnumpublic <E extends java.lang.Enum> ConfigCondition optionalEnum(java.lang.String name, java.lang.Class<E> enumClass, boolean ignoreCase) throws ConfigurationException - Throws:
- ConfigurationException
 
 - 
optionalObjectpublic ConfigCondition optionalObject(java.lang.String name) throws ConfigurationException Checks to see if a member with the given name exists. If it does, ensures that it is an object.- Throws:
- ConfigurationException
 
 - 
optionalArraypublic ConfigCondition optionalArray(java.lang.String name) throws ConfigurationException Checks to see if a member with the given name exists. If it does, ensures that it is an array.- Throws:
- ConfigurationException
 
 - 
optionalBooleanpublic ConfigCondition optionalBoolean(java.lang.String name) throws ConfigurationException Checks to see if a member with the given name exists. If it does, ensures that it is a boolean.- Throws:
- ConfigurationException
 
 - 
optionalStringpublic ConfigCondition optionalString(java.lang.String name) throws ConfigurationException Checks to see if a member with the given name exists. If it does, ensures that it is a string.- Throws:
- ConfigurationException
 
 - 
optionalpublic ConfigCondition optional(java.lang.String name, java.util.function.Predicate<com.inductiveautomation.ignition.common.gson.JsonElement> predicate, java.util.function.Function<com.inductiveautomation.ignition.common.gson.JsonElement,java.lang.String> errorMessage) throws ConfigurationException General purpose optional-check. If the object at the given name is missing, this is OK. But if the object is present, it must pass the predicate.- Throws:
- ConfigurationException
 
 
- 
 
-