public class

WebEventUtils

extends Object
java.lang.Object
   ↳ com.microstrategy.web.beans.WebEventUtils

Class Overview

The WebEventUtils class is a utility class, helping users to retrieve values from a WebEvent object.

Summary

Public Constructors
WebEventUtils()
Public Methods
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 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 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 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.
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.
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.
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.
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 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 String[] parseArgumentValue(String val, String delim)
Parses string value into array of values using specified delimitor.
static String[][] parseArgumentValue(String value, String[] parameterTitles, String itemDelimiter, String unitDelimiter, boolean[] inheritFlags)
Parses string value into array of string arrays using specified delimiters.
static String[][] parseArgumentValue(String value, String[] parameterTitles, String itemDelimiter, String unitDelimiter, boolean inheritFlag)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WebEventUtils ()

Public Methods

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.

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.

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.

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.

public 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.

public 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.

public 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.

public 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.

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.

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.

public static String[] parseArgumentValue (String val, 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

public static String[][] parseArgumentValue (String value, String[] parameterTitles, String itemDelimiter, 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

public static String[][] parseArgumentValue (String value, String[] parameterTitles, String itemDelimiter, String unitDelimiter, boolean inheritFlag)