Package gov.niem.tools.api.core.utils
Class AppUtils
java.lang.Object
gov.niem.tools.api.core.utils.AppUtils
General utility functions for the application.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcaptureLog(Runnable runnable) Capture console output for the given runnable and return as a string.static org.springframework.http.ResponseEntity<String> getResponseOkJson(String message) Returns an OK JSON response.static org.springframework.http.ResponseEntity<String> getResponseOkString(String message) Returns an OK plain text response.static org.springframework.http.ResponseEntity<String> getResponseUnprocessableString(String message) Returns an Unprocessable Entity plain text response.static StringGets the current date and time with formatting.static StringLogs the given message.static StringLogs the given arguments as a formatted message.
-
Constructor Details
-
AppUtils
public AppUtils()
-
-
Method Details
-
log
Logs the given message. -
log
Logs the given arguments as a formatted message. -
getResponseOkString
Returns an OK plain text response. -
getResponseOkJson
Returns an OK JSON response. -
getResponseUnprocessableString
public static org.springframework.http.ResponseEntity<String> getResponseUnprocessableString(String message) Returns an Unprocessable Entity plain text response. -
getTimestamp
Gets the current date and time with formatting. -
captureLog
Capture console output for the given runnable and return as a string.
-