Class InlineJexlToolbox

java.lang.Object
de.gematik.test.tiger.common.jexl.InlineJexlToolbox

public class InlineJexlToolbox extends Object
  • Constructor Details

    • InlineJexlToolbox

      public InlineJexlToolbox()
  • Method Details

    • file

      public static String file(String filename)
      reads file - not post-processed, no variable substitution
      Parameters:
      filename - path to file
      Returns:
      content of the file
    • resolve

      public String resolve(String value)
      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

      public String getValue(String variableName)
      reads the value of the variable from TigerGlobalConfiguration
      Parameters:
      variableName - name of the variable
      Returns:
      value of the property of the TigerGlobalConfiguration
    • sha256

      public String sha256(String value)
      reads string value and transforms to SHA256 format
      Parameters:
      value - string to be read
      Returns:
      encoded value in SHA256 format
    • sha512

      public String sha512(String value)
      reads string value and transforms to SHA512
      Parameters:
      value - string to be read
      Returns:
      encoded values in SHA512 format
    • sha512Base64

      public String sha512Base64(String value)
      reads string value and transforms to base64 of sha512 hash
      Parameters:
      value - string to be read
      Returns:
      encoded sha512 value in base64 format
    • md5

      public String md5(String value)
      reads string value and transforms to md5
      Parameters:
      value - string to be read
      Returns:
      encoded values in md5 format
    • md5Base64

      public String md5Base64(String value)
      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

      public String base64Encode(String value)
      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

      public String base64UrlEncode(String value)
      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

      public String base64Decode(String value)
      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

      public String randomHex(int size)
      array of chars
      Parameters:
      size - array size to be returned
      Returns:
      array of random hex chars of given size
    • urlEncoded

      public String urlEncoded(String value)
      url encodes a string
      Parameters:
      value - final String
      Returns:
      if value not null, the url encoded representation of the string is returned
    • subStringAfter

      public String subStringAfter(String value, String token)
      implements String.substringAfter method,
      Parameters:
      value - string to get sub string of
      token - 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

      public String subStringBefore(String value, String token)
      implements String.substringBefore method
      Parameters:
      value - string to get sub string of
      token - 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

      public String sha256Base64(String value)
      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

      public String currentLocalDate()
      logs current date
      Returns:
      current date in LocalDate-format
    • currentLocalDateTime

      public String currentLocalDateTime()
      logs current datetime
      Returns:
      current date in LocalDateTime-format
    • currentZonedDateTime

      public String currentZonedDateTime()
      logs current datetime including timezone
      Returns:
      current date in ZonedDateTime-format
    • lowerCase

      public String lowerCase(String value)
      transforms string to lower case
      Parameters:
      value - final String
      Returns:
      if value not null, the input string is returned in lower case letters
    • upperCase

      public String upperCase(String value)
      transforms string to lower case
      Parameters:
      value - final String
      Returns:
      if value not null, the input string is returned in upper case letters