Package com.microstrategy.web.beans
Class WebEventUtils
- java.lang.Object
-
- com.microstrategy.web.beans.WebEventUtils
-
public class WebEventUtils extends java.lang.Object
TheWebEventUtils
class is a utility class, helping users to retrieve values from aWebEvent
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 index0
from the specifiedWebEvent
.static boolean
getBooleanValue(WebEvent event, int id, boolean defaultValue)
Returns the boolean value of the event argument with the specified identifier at index0
from the specifiedWebEvent
.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 specifiedWebEvent
.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 specifiedWebEvent
.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 specifiedWebEvent
.static int
getIndexedIntValue(WebEvent event, int id, int index, int defaultValue)
Returns the integer value of the event argument with the specified identifier at index0
from the specifiedWebEvent
.static int
getIntValue(WebEvent event, int id)
Returns the integer value of the event argument with the specified identifier at index0
from the specifiedWebEvent
.static int
getIntValue(WebEvent event, int id, int defaultValue)
Returns the integer value of the event argument with the specified identifier at index0
from the specifiedWebEvent
.static boolean
isEmpty(WebEvent event, int id)
Returnstrue
if the event argument with the specified identifier at index0
from the specifiedWebEvent
has value of either null or empty string.static boolean
isEmptyIndexed(WebEvent event, int id, int index)
Returnstrue
if the event argument with the specified identifier at the specified index from the specifiedWebEvent
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.
-
-
-
Method Detail
-
isEmpty
public static boolean isEmpty(WebEvent event, int id)
Returnstrue
if the event argument with the specified identifier at index0
from the specifiedWebEvent
has value of either null or empty string.- Parameters:
event
- the {link WebEvent} object contains the argumentid
- 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)
Returnstrue
if the event argument with the specified identifier at the specified index from the specifiedWebEvent
has value of either null or empty string.- Parameters:
event
- the {link WebEvent} object contains the argumentid
- the argument idindex
- 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 valuedelim
- 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 valueparameterTitles
- Record headersitemDelimiter
- Item delimiterunitDelimiter
- 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 index0
from the specifiedWebEvent
. String value "1" is also taken astrue
.- Parameters:
event
- theWebEvent
containing the argumentid
- 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 specifiedWebEvent
. String value "1" is also taken astrue
.- Parameters:
event
- theWebEvent
containing the argumentid
- 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 index0
from the specifiedWebEvent
. String value "1" is also taken astrue
.if the argument value is null, the specified
defaultValue
is returned.- Parameters:
event
- theWebEvent
containing the argumentid
- 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 specifiedWebEvent
. String value "1" is also taken astrue
.if the argument value is null, the specified
defaultValue
is returned.- Parameters:
event
- theWebEvent
containing the argumentid
- 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 index0
from the specifiedWebEvent
.- Parameters:
event
- theWebEvent
containing the argumentid
- 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 specifiedWebEvent
.- Parameters:
event
- theWebEvent
containing the argumentid
- 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 index0
from the specifiedWebEvent
.if the argument value is null or can not be parsed into an integer, the specified
defaultValue
is returned.- Parameters:
event
- theWebEvent
containing the argumentid
- 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 index0
from the specifiedWebEvent
.if the argument value is null or can not be parsed into an integer, the specified
defaultValue
is returned.- Parameters:
event
- theWebEvent
containing the argumentid
- 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.
-
-