Class InlineJexlToolbox
java.lang.Object
de.gematik.test.tiger.common.jexl.InlineJexlToolbox
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbase64Decode(String value) reads base64 encoded string value and safely decodes to stringbase64Encode(String value) reads string value and transforms to base64base64UrlEncode(String value) reads string value and safely transforms to url encoded base64logs current datelogs current datetimelonglogs current timelogs current datetime including timezonestatic Stringreads file - not post-processed, no variable substitutionreads the value of the variable from TigerGlobalConfigurationtransforms string to lower casereads string value and transforms to md5reads string value and transforms to base64 of the md5 hashrandomHex(int size) array of charsparses the given string value and resolves / substitutes all placeholder tokens of the form ${...} and !{...}reads string value and transforms to SHA256 formatsha256Base64(String value) reads string value and transforms to base64reads string value and transforms to SHA512sha512Base64(String value) reads string value and transforms to base64 of sha512 hashsubStringAfter(String value, String token) implements String.substringAfter method,subStringBefore(String value, String token) implements String.substringBefore methodtransforms string to lower caseurlEncoded(String value) url encodes a string
-
Constructor Details
-
InlineJexlToolbox
public InlineJexlToolbox()
-
-
Method Details
-
file
reads file - not post-processed, no variable substitution- Parameters:
filename- path to file- Returns:
- content of the file
-
resolve
parses the given string value and resolves / substitutes all placeholder tokens of the form ${...} and !{...}- Parameters:
value- string to be resolved- Returns:
- Tiger globalConfigurationLoader
-
getValue
reads the value of the variable from TigerGlobalConfiguration- Parameters:
variableName- name of the variable- Returns:
- value of the property of the TigerGlobalConfiguration
-
sha256
reads string value and transforms to SHA256 format- Parameters:
value- string to be read- Returns:
- encoded value in SHA256 format
-
sha512
reads string value and transforms to SHA512- Parameters:
value- string to be read- Returns:
- encoded values in SHA512 format
-
sha512Base64
reads string value and transforms to base64 of sha512 hash- Parameters:
value- string to be read- Returns:
- encoded sha512 value in base64 format
-
md5
reads string value and transforms to md5- Parameters:
value- string to be read- Returns:
- encoded values in md5 format
-
md5Base64
reads string value and transforms to base64 of the md5 hash- Parameters:
value- string to be read- Returns:
- if value is not null, encoded md5 values in base64 format are returned, else null
-
base64Encode
reads string value and transforms to base64- Parameters:
value- string to be read- Returns:
- if value is not null, base64 encoded values in UTF8 format are returned, else null
-
base64UrlEncode
reads string value and safely transforms to url encoded base64- Parameters:
value- string to be read- Returns:
- if value is not null, base64 encoded values in ASCII and URL safe format are returned, else null
-
base64Decode
reads base64 encoded string value and safely decodes to string- Parameters:
value- base64 encoded string to be read- Returns:
- if value is not null, base64 decoded value is returned as String, else null
-
randomHex
array of chars- Parameters:
size- array size to be returned- Returns:
- array of random hex chars of given size
-
urlEncoded
url encodes a string- Parameters:
value- final String- Returns:
- if value not null, the url encoded representation of the string is returned
-
subStringAfter
implements String.substringAfter method,- Parameters:
value- string to get sub string oftoken- token to look for in the search string- Returns:
- if value not null, the substring that comes after the first occurrence of the given token is returned
-
subStringBefore
implements String.substringBefore method- Parameters:
value- string to get sub string oftoken- token to look for in the search string- Returns:
- if value not null, the substring that comes before the first occurrence of the given token is returned
-
sha256Base64
reads string value and transforms to base64- Parameters:
value- SHA256 value- Returns:
- encoded value in base64 format
-
currentTimestamp
public long currentTimestamp()logs current time- Returns:
- current time in seconds
-
currentLocalDate
logs current date- Returns:
- current date in LocalDate-format
-
currentLocalDateTime
logs current datetime- Returns:
- current date in LocalDateTime-format
-
currentZonedDateTime
logs current datetime including timezone- Returns:
- current date in ZonedDateTime-format
-
lowerCase
transforms string to lower case- Parameters:
value- final String- Returns:
- if value not null, the input string is returned in lower case letters
-
upperCase
transforms string to lower case- Parameters:
value- final String- Returns:
- if value not null, the input string is returned in upper case letters
-