Class CustomFieldsAdapter
- java.lang.Object
-
- com.dtolabs.rundeck.core.execution.workflow.steps.CustomFieldsAdapter
-
public class CustomFieldsAdapter extends java.lang.Object
Assists in converting plugin property values with DYNAMIC_FORM rendering option, so that variable expansion can be done within the field values of the JSON structure.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CustomFieldsAdapter.CustomField
Represents a custom field entrystatic class
CustomFieldsAdapter.CustomFields
Represents a list of custom fields, and contains a Map that holds the key/value pairs for easy lookup
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
convertInput(java.lang.String key, java.lang.Object input)
Given property key, and input value, convert the value if it is a JSON representation of an array of CustomFieldsstatic CustomFieldsAdapter.CustomFields
convertJsonCustomFieldValues(java.lang.String input)
Parse the input as a JSON representation of an array of CustomFieldsjava.lang.Object
convertOutput(java.lang.String key, java.lang.Object output)
Given property key, and output value, restore the value back to JSON stringstatic CustomFieldsAdapter
create(Description description)
Create a new instancestatic java.lang.String
replaceConvertedCustomFieldValues(CustomFieldsAdapter.CustomFields customFields, java.util.Map<java.lang.String,java.lang.String> converted)
Given a map of converted values, replace the values in the CustomFields object and return the JSON serialized
-
-
-
Method Detail
-
create
public static CustomFieldsAdapter create(Description description)
Create a new instance- Parameters:
description
- description- Returns:
- instance
-
replaceConvertedCustomFieldValues
public static java.lang.String replaceConvertedCustomFieldValues(CustomFieldsAdapter.CustomFields customFields, java.util.Map<java.lang.String,java.lang.String> converted)
Given a map of converted values, replace the values in the CustomFields object and return the JSON serialized- Parameters:
customFields
- CustomFields objectconverted
- converted values- Returns:
- json serialized string of new value, or null if there is an error
-
convertJsonCustomFieldValues
public static CustomFieldsAdapter.CustomFields convertJsonCustomFieldValues(java.lang.String input)
Parse the input as a JSON representation of an array of CustomFields- Parameters:
input
- input string- Returns:
- CustomFields object, or null if there is an error
-
convertInput
public java.lang.Object convertInput(java.lang.String key, java.lang.Object input)
Given property key, and input value, convert the value if it is a JSON representation of an array of CustomFields- Parameters:
key
- property keyinput
- input value- Returns:
- converted value, or original value if not converted
-
convertOutput
public java.lang.Object convertOutput(java.lang.String key, java.lang.Object output)
Given property key, and output value, restore the value back to JSON string- Parameters:
key
- property keyoutput
- output value- Returns:
- json serialized string of new value, or original value if not converted
-
-