public class BoilerplateNameResolver extends Object
| Constructor and Description |
|---|
BoilerplateNameResolver(com.hpe.caf.boilerplate.webcaller.ApiClient apiClient)
Creates new instance of BoilerplateNameResolver
|
| Modifier and Type | Method and Description |
|---|---|
void |
populateExpressionsFromApiCall()
Populates the known mapping of expression names to expression IDs by querying the boilerplate API for all existing expressions.
|
void |
populateExpressionsFromApiCall(String projectId) |
void |
populateFromCreationResult(CreationResultJson boilerplateCreationResult)
Records the names and IDs from the provided creation result for use in later resolution.
|
void |
populateTagsFromApiCall()
Populates the known mapping of tag names to tag IDs by querying the boilerplate API for all existing tags.
|
List<Object> |
resolveExpressionIds(ArrayList expressionIdsObj)
Takes in an array of expression IDs, with each ID being either the expression ID or the name of the expression, and returns
an array of resovled expression IDs.
|
Long |
resolveFromExpressionName(String expressionName)
Returns the boilerplate expression ID matching the provided name.
|
Long |
resolveFromTagName(String tagName)
Returns the tag ID matching the provided name.
|
Object |
resolveTagId(Object tagId)
Takes an object which may be either a String (containing name of a tag) or an Integer/Long (containing ID of tag) and returns the appropriate tag ID.
|
public BoilerplateNameResolver(com.hpe.caf.boilerplate.webcaller.ApiClient apiClient)
apiClient - ApiClient to use to create BoilerplateApi which will be contacted to resolve unknown names.public void populateFromCreationResult(CreationResultJson boilerplateCreationResult)
boilerplateCreationResult - Creation Result with boilerplate expression/tag names and IDs.public void populateExpressionsFromApiCall(String projectId) throws com.hpe.caf.boilerplate.webcaller.ApiException
com.hpe.caf.boilerplate.webcaller.ApiExceptionpublic void populateExpressionsFromApiCall()
throws com.hpe.caf.boilerplate.webcaller.ApiException
com.hpe.caf.boilerplate.webcaller.ApiException - Thrown if there is an error communicating with the API or if error response received from API.public void populateTagsFromApiCall()
throws com.hpe.caf.boilerplate.webcaller.ApiException
com.hpe.caf.boilerplate.webcaller.ApiException - Thrown if there is an error communicating with the API or if error response received from API.public Long resolveFromTagName(String tagName)
tagName - Name to get ID for.public Long resolveFromExpressionName(String expressionName)
expressionName - Name to get ID for.public List<Object> resolveExpressionIds(ArrayList expressionIdsObj)
expressionIdsObj - Array of numeric IDs and expression names.Copyright © 2015–2017 Hewlett Packard Enterprise Development LP. All rights reserved.