Class JS4JUtils

java.lang.Object
com.api.jsonata4java.expressions.JS4JUtils
All Implemented Interfaces:
Serializable

public class JS4JUtils extends Object implements Serializable
See Also:
  • Field Details

  • Constructor Details

    • JS4JUtils

      public JS4JUtils()
  • Method Details

    • convertTimeZoneToMilliseconds

      public static int convertTimeZoneToMilliseconds(String strTimeZone)
      Converts a timezone of the format +/-hhmm to milliseconds
      Parameters:
      strTimeZone - timezone offset from Greenwich Mean Time (GMT) for example "-0500" is Eastern Standard Time, "-0400" is Eastern Daylight Time, "+0000" is Greenwich Mean Time, and "+0100" is the offset for Europe/Paris.
      Returns:
      milliseconds from Greenwich Mean Time
    • padRight

      public static String padRight(long lIn, int iWidth, char cPad)
      Helper method to create strings of the form "nn000".
      Parameters:
      lIn - long value to be right justified with leading characters in the returned String.
      iWidth - integer value of the width of the returned String.
      cPad - character value to be used to pad the right portion of the returned String to make it as wide as the specified iWidth parameter. For example, calling toRightPaddedString(iNum,4,'0') would result in "4500" if iNum == 45, or "4000" if iNum == 4.
      Returns:
      String containing the right justified value, padded to the specified with the specified pad character.
    • padRight

      public static String padRight(int iIn, int iWidth, char cPad)
      Helper method to create strings of the form "nn000".
      Parameters:
      iIn - integer value to be right justified with leading characters in the returned String.
      iWidth - integer value of the width of the returned String.
      cPad - character value to be used to pad the right portion of the returned String to make it as wide as the specified iWidth parameter. For example, calling toRightPaddedString(iNum,4,'0') would result in "4500" if iNum == 45, or "4000" if iNum == 4.
      Returns:
      String containing the right justified value, padded to the specified with the specified pad character.
    • padRight

      public static String padRight(String strInput, int iMax, char cPadChar)
      Creates a new String padded on its right side with the supplied pad character guaranteed to be the supplied length. If the supplied length is less than or equal to the length of the supplied string, the supplied string is returned. If the supplied string is null, a new string is returned filled with the supplied pad character that is as long as the supplied length.
      Parameters:
      strInput -
      iMax -
      cPadChar -
      Returns:
      formatted string with padding