Class WebEventUtils


  • public class WebEventUtils
    extends java.lang.Object
    The WebEventUtils class is a utility class, helping users to retrieve values from a WebEvent object.
    Since:
    MicroStrategy Web 8.0.0
    • Constructor Summary

      Constructors 
      Constructor Description
      WebEventUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean getBooleanValue​(WebEvent event, int id)
      Returns the boolean value of the event argument with the specified identifier at index 0 from the specified WebEvent.
      static boolean getBooleanValue​(WebEvent event, int id, boolean defaultValue)
      Returns the boolean value of the event argument with the specified identifier at index 0 from the specified WebEvent.
      static boolean getIndexedBooleanValue​(WebEvent event, int id, int index)
      Returns the boolean value of the event argument with the specified identifier at the specified index from the specified WebEvent.
      static boolean getIndexedBooleanValue​(WebEvent event, int id, int index, boolean defaultValue)
      Returns the boolean value of the event argument with the specified identifier at the specified index from the specified WebEvent.
      static int getIndexedIntValue​(WebEvent event, int id, int index)
      Returns the integer value of the event argument with the specified identifier at the specified index from the specified WebEvent.
      static int getIndexedIntValue​(WebEvent event, int id, int index, int defaultValue)
      Returns the integer value of the event argument with the specified identifier at index 0 from the specified WebEvent.
      static int getIntValue​(WebEvent event, int id)
      Returns the integer value of the event argument with the specified identifier at index 0 from the specified WebEvent.
      static int getIntValue​(WebEvent event, int id, int defaultValue)
      Returns the integer value of the event argument with the specified identifier at index 0 from the specified WebEvent.
      static boolean isEmpty​(WebEvent event, int id)
      Returns true if the event argument with the specified identifier at index 0 from the specified WebEvent has value of either null or empty string.
      static boolean isEmptyIndexed​(WebEvent event, int id, int index)
      Returns true if the event argument with the specified identifier at the specified index from the specified WebEvent has value of either null or empty string.
      static java.lang.String[] parseArgumentValue​(java.lang.String val, java.lang.String delim)
      Parses string value into array of values using specified delimitor.
      static java.lang.String[][] parseArgumentValue​(java.lang.String value, java.lang.String[] parameterTitles, java.lang.String itemDelimiter, java.lang.String unitDelimiter, boolean inheritFlag)  
      static java.lang.String[][] parseArgumentValue​(java.lang.String value, java.lang.String[] parameterTitles, java.lang.String itemDelimiter, java.lang.String unitDelimiter, boolean[] inheritFlags)
      Parses string value into array of string arrays using specified delimiters.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebEventUtils

        public WebEventUtils()
    • Method Detail

      • isEmpty

        public static boolean isEmpty​(WebEvent event,
                                      int id)
        Returns true if the event argument with the specified identifier at index 0 from the specified WebEvent has value of either null or empty string.
        Parameters:
        event - the {link WebEvent} object contains the argument
        id - the argument id
        Returns:
        true if the argumet value is null or empty string.
      • isEmptyIndexed

        public static boolean isEmptyIndexed​(WebEvent event,
                                             int id,
                                             int index)
        Returns true if the event argument with the specified identifier at the specified index from the specified WebEvent has value of either null or empty string.
        Parameters:
        event - the {link WebEvent} object contains the argument
        id - the argument id
        index - the index into the set of argument values in the event.
        Returns:
        true if the argumet value is null or empty string.
      • parseArgumentValue

        public static java.lang.String[] parseArgumentValue​(java.lang.String val,
                                                            java.lang.String delim)
        Parses string value into array of values using specified delimitor.
        Parameters:
        val - Original value
        delim - Delimiter used for parsing
        Returns:
        String[] array of values. It will return empty array if the original string is null or empty string
      • parseArgumentValue

        public static java.lang.String[][] parseArgumentValue​(java.lang.String value,
                                                              java.lang.String[] parameterTitles,
                                                              java.lang.String itemDelimiter,
                                                              java.lang.String unitDelimiter,
                                                              boolean[] inheritFlags)
        Parses string value into array of string arrays using specified delimiters. The original string consists of one or several units separated by the unit delimiter. Each unit consists of items separated by the item delimiter.

        The number of items in the first unit determines the number of items in the each subsequent unit. If the number of items in a subsequent unit is less then the number of items in the first one then depending on the value of the inheritFlag parameter the unit will be padded either by the nulls or by the corresponding values in the previous unit.

        Parameters:
        value - Original value
        parameterTitles - Record headers
        itemDelimiter - Item delimiter
        unitDelimiter - Unit delimiter *
        inheritFlags - a flag indication that empty item values shall be replaced by corresponding values from the previous unit.
        Returns:
        String[][] array of string arrays. It will return empty array if the original string is null or empty string
        Since:
        MicroStrategy Web 8.1.0
      • parseArgumentValue

        public static java.lang.String[][] parseArgumentValue​(java.lang.String value,
                                                              java.lang.String[] parameterTitles,
                                                              java.lang.String itemDelimiter,
                                                              java.lang.String unitDelimiter,
                                                              boolean inheritFlag)
      • getBooleanValue

        public static boolean getBooleanValue​(WebEvent event,
                                              int id)
        Returns the boolean value of the event argument with the specified identifier at index 0 from the specified WebEvent. String value "1" is also taken as true.
        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        Returns:
        the boolean value of the specified argument.
      • getIndexedBooleanValue

        public static boolean getIndexedBooleanValue​(WebEvent event,
                                                     int id,
                                                     int index)
        Returns the boolean value of the event argument with the specified identifier at the specified index from the specified WebEvent. String value "1" is also taken as true.
        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        index - the index into the set of argument values in the event.
        Returns:
        the boolean value of the specified argument.
      • getBooleanValue

        public static boolean getBooleanValue​(WebEvent event,
                                              int id,
                                              boolean defaultValue)
        Returns the boolean value of the event argument with the specified identifier at index 0 from the specified WebEvent. String value "1" is also taken as true.

        if the argument value is null, the specified defaultValue is returned.

        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        defaultValue - the default value to return if the argument value is null.
        Returns:
        the boolean value of the specified argument.
      • getIndexedBooleanValue

        public static boolean getIndexedBooleanValue​(WebEvent event,
                                                     int id,
                                                     int index,
                                                     boolean defaultValue)
        Returns the boolean value of the event argument with the specified identifier at the specified index from the specified WebEvent. String value "1" is also taken as true.

        if the argument value is null, the specified defaultValue is returned.

        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        index - the index into the set of argument values in the event.
        defaultValue - the default value to return if the argument value is null.
        Returns:
        the boolean value of the specified argument.
      • getIntValue

        public static int getIntValue​(WebEvent event,
                                      int id)
        Returns the integer value of the event argument with the specified identifier at index 0 from the specified WebEvent.
        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        Returns:
        the integer value of the specified argument.
      • getIndexedIntValue

        public static int getIndexedIntValue​(WebEvent event,
                                             int id,
                                             int index)
        Returns the integer value of the event argument with the specified identifier at the specified index from the specified WebEvent.
        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        index - the index into the set of argument values in the event.
        Returns:
        the integer value of the specified argument.
      • getIntValue

        public static int getIntValue​(WebEvent event,
                                      int id,
                                      int defaultValue)
        Returns the integer value of the event argument with the specified identifier at index 0 from the specified WebEvent.

        if the argument value is null or can not be parsed into an integer, the specified defaultValue is returned.

        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        defaultValue - the default value to return if the argument value is null.
        Returns:
        the integer value of the specified argument.
      • getIndexedIntValue

        public static int getIndexedIntValue​(WebEvent event,
                                             int id,
                                             int index,
                                             int defaultValue)
        Returns the integer value of the event argument with the specified identifier at index 0 from the specified WebEvent.

        if the argument value is null or can not be parsed into an integer, the specified defaultValue is returned.

        Parameters:
        event - the WebEvent containing the argument
        id - the argument id.
        index - the index into the set of argument values in the event.
        defaultValue - the default value to return if the argument value is null.
        Returns:
        the integer value of the specified argument.