Class RestUtil
- java.lang.Object
-
- org.neotropic.kuwaiba.northbound.rest.RestUtil
-
public class RestUtil extends Object
Set of methods to use in the REST Controllers- Author:
- Johny Andres Ortega Ruiz <johny.ortega@kuwaiba.org>
-
-
Constructor Summary
Constructors Constructor Description RestUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.springframework.http.ResponseEntitygetResponseEntity(Exception ex)Gets a no content response.static booleanisBase64(String string)Evaluates if a string is in Base64 format.static ArtifacttransientArtifactToArtifact(TransientArtifact artifact)Helper class to parse from a TransientArtifact into a Artifact.static ScriptedQueryParametertransientScriptedQueryParameterToScriptedQueryParameter(TransientScriptedQueryParameter parameter)Helper class to parse from a TransientScriptedQueryParameter into a ScriptedQueryParameter.
-
-
-
Method Detail
-
getResponseEntity
public static org.springframework.http.ResponseEntity getResponseEntity(Exception ex)
Gets a no content response.- Parameters:
ex- Throw exception- Returns:
- A no content response with header error.
-
isBase64
public static boolean isBase64(String string)
Evaluates if a string is in Base64 format.- Parameters:
string- String to be evaluated.- Returns:
- True if the string is in Base64 format otherwise false.
-
transientScriptedQueryParameterToScriptedQueryParameter
public static ScriptedQueryParameter transientScriptedQueryParameterToScriptedQueryParameter(TransientScriptedQueryParameter parameter)
Helper class to parse from a TransientScriptedQueryParameter into a ScriptedQueryParameter.- Parameters:
parameter- Transient ScriptedQuery Parameter.- Returns:
- ScriptedQueryParameter.
-
transientArtifactToArtifact
public static Artifact transientArtifactToArtifact(TransientArtifact artifact)
Helper class to parse from a TransientArtifact into a Artifact.- Parameters:
artifact- Transient Artifact.- Returns:
- Artifact.
-
-