public abstract class AbstractArgumentTransformer<T> extends Object implements ArgumentTransformer
Modifier and Type | Field and Description |
---|---|
protected JiraManagersService |
jiraManagersService |
Modifier | Constructor and Description |
---|---|
protected |
AbstractArgumentTransformer(JiraManagersService jiraManagersService) |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
collectReference(String key,
T reference,
com.botronsoft.cmj.spi.configuration.ConfigurationReferenceCollector referenceCollector)
Collects the referenced Jira object.
|
protected T |
findFirstMatch(Collection<T> matches,
String objectName,
String objectType)
Returns the first match of all matched references
|
protected abstract T |
findReferenceById(String value)
Implementations should provide means for resolving a Jira object when the value is treated as an ID.
|
protected T |
findReferenceByKey(String value)
Implementations should provide means for resolving a Jira object when the value is treated as a key.
|
protected abstract T |
findReferenceByName(String value)
Implementations should provide means for resolving a Jira object when the value is treated as a name.
|
protected abstract String |
getReferenceId(T reference)
Returns the ID of the referenced object.
|
protected String |
getReferenceKey(T reference)
Returns the key of the referenced object.
|
protected abstract String |
getReferenceName(T reference)
Returns the name of the referenced object.
|
protected abstract Optional<T> |
lookupReference(String key,
com.botronsoft.cmj.spi.configuration.ConfigurationReferenceLookup referenceLookup)
Resolves a reference by its key using the SPI reference lookup implementation.
|
String |
transformArgumentForExport(String value,
Configuration configuration,
com.botronsoft.cmj.spi.configuration.ConfigurationReferenceCollector referenceCollector)
Transforms argument value for export.
|
String |
transformArgumentForImport(String value,
Configuration configuration,
com.botronsoft.cmj.spi.configuration.ConfigurationReferenceLookup referenceLookup)
Transforms argument value for import.
|
protected final JiraManagersService jiraManagersService
protected AbstractArgumentTransformer(JiraManagersService jiraManagersService)
public final String transformArgumentForExport(String value, Configuration configuration, com.botronsoft.cmj.spi.configuration.ConfigurationReferenceCollector referenceCollector)
ArgumentTransformer
transformArgumentForExport
in interface ArgumentTransformer
value
- value to be transformedconfiguration
- the transformation configurationreferenceCollector
- instance of ConfigurationReferenceCollector
from the SPI.public final String transformArgumentForImport(String value, Configuration configuration, com.botronsoft.cmj.spi.configuration.ConfigurationReferenceLookup referenceLookup)
ArgumentTransformer
transformArgumentForImport
in interface ArgumentTransformer
value
- value to be transformedconfiguration
- the transformation configurationreferenceLookup
- instance of ConfigurationReferenceLookup
from the SPI.protected abstract T findReferenceById(String value)
value
- the id of the object.null
if not found. Intentionally returns null
to keep implementations clean.protected abstract T findReferenceByName(String value)
value
- the name of the object.null
if not found. Intentionally returns null
to keep implementations clean.protected T findReferenceByKey(String value)
value
- the name of the object.null
if not found. Intentionally returns null
to keep implementations clean.protected abstract void collectReference(String key, T reference, com.botronsoft.cmj.spi.configuration.ConfigurationReferenceCollector referenceCollector)
key
- the reference key.reference
- the referenced Jira object.referenceCollector
- the SPI reference collector implementation.protected abstract String getReferenceId(T reference)
reference
- the Jira object.protected abstract String getReferenceName(T reference)
reference
- the Jira object.protected String getReferenceKey(T reference)
reference
- the Jira object.protected abstract Optional<T> lookupReference(String key, com.botronsoft.cmj.spi.configuration.ConfigurationReferenceLookup referenceLookup)
key
- the lookup key.referenceLookup
- the SPI reference lookup implementation.Optional
.protected T findFirstMatch(Collection<T> matches, String objectName, String objectType)
matches
- all the matchesCopyright © 2022. All rights reserved.