public class AdminExpressionVariable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
AND
Expression type.
|
private int |
andOr
Defines whether this variable has to be ANDed or ORed with the one that precedes it.
|
private int |
customerTagId
Id of the customer tag for this variable
|
private java.lang.String |
customerValue
The customer value for the tag which is compared to the
value attribute when
evaluating the expression variable. |
static int |
EQUAL
Comparison type.
|
private int |
expressionId
Id of the expression that this variable belongs to
|
static int |
GREATER_EQUAL
Comparison type.
|
static int |
GREATER_THAN
Comparison type.
|
private int |
groupAndOr
Defines whether this group has to be ANDed or ORed with the one that precedes it.
|
private int |
groupOrder
The order of the group that this expression variable belongs to.
|
private int |
id
id
|
static int |
LESS_EQUAL
Comparison type.
|
static int |
LESS_THAN
Comparison type.
|
static int |
MATCH
Comparison type to match regular expression
|
static int |
N_A
Tag value not available
|
static int |
NOT_EQUAL
Comparison type.
|
private int |
operator
Valid operators are:
AdminExpressionVariable.EQUAL
AdminExpressionVariable.NOT_EQUAL
AdminExpressionVariable.GREATER_EQUAL
AdminExpressionVariable.GREATER_THAN
AdminExpressionVariable.LESS_EQUAL
AdminExpressionVariable.LESS_THAN
AdminExpressionVariable.MATCH - Used to match regular expression
Note that not all operators are valid for all tag types.
|
static int |
OR
Expression type.
|
private int |
order
The order of this expression variable.
|
private int |
type
The type of variable.
|
private java.lang.String |
value
The value of the expression variable.
|
Constructor and Description |
---|
AdminExpressionVariable()
Constructor
|
AdminExpressionVariable(com.workingdogs.village.Record vr,
com.konakart.db.KKCriteria c)
Instantiates the attributes of the Tag object from a Record object
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
compareAge(int oper)
The value attribute is the age in seconds.
|
protected boolean |
compareBooleans(int oper)
Compare Booleans
|
protected boolean |
compareDates(int oper)
Compare dates which are stored as strings containing the millisecond value
|
protected boolean |
compareDecimals(int oper)
Compare decimals
|
protected boolean |
compareInts(int oper)
Compare integers
|
protected boolean |
compareMultiInt(int oper)
Compare Multi ints which are stored as integers separated by AdminCustomerTag.DELIM
|
protected boolean |
compareMultiIntPlusTime(int oper)
Compare Multi ints which are stored as integer and timestamp pairs separated by AdminCustomerTag.DELIM
|
protected boolean |
compareStrings(int oper)
Compare strings
|
boolean |
evaluate()
Evaluates the variable by comparing the
value attribute with the
customerValue attribute using the operator attribute. |
int |
getAndOr() |
int |
getCustomerTagId() |
java.lang.String |
getCustomerValue() |
int |
getExpressionId() |
int |
getGroupAndOr() |
int |
getGroupOrder() |
int |
getId() |
int |
getOperator() |
protected java.lang.String |
getOperatorName(int oper)
Returns the name of the operator mainly for reporting purposes.
|
int |
getOrder() |
int |
getType() |
java.lang.String |
getValue() |
void |
setAndOr(int andOr) |
void |
setCustomerTagId(int customerTagId) |
void |
setCustomerValue(java.lang.String customerValue) |
void |
setExpressionId(int expressionId) |
void |
setGroupAndOr(int groupAndOr) |
void |
setGroupOrder(int groupOrder) |
void |
setId(int id) |
void |
setOperator(int operator) |
void |
setOrder(int order) |
void |
setType(int type) |
void |
setValue(java.lang.String value) |
java.lang.String |
toString() |
public static final int EQUAL
public static final int NOT_EQUAL
public static final int GREATER_THAN
public static final int LESS_THAN
public static final int GREATER_EQUAL
public static final int LESS_EQUAL
public static final int MATCH
public static final int N_A
public static final int AND
public static final int OR
private int id
private int customerTagId
private int expressionId
private int type
AdminCustomerTag.STRING_TYPE
: The value is a StringAdminCustomerTag.INT_TYPE
: The value is an integerAdminCustomerTag.MULTI_INT_TYPE
: The value contains one or more integers
separated by a delimiter. The maxInts
attributes determines how many integers
are allowed.MULTI_INT_PLUS_TIME_TYPE
: The tag value contains one or more integer and
timestamp pairs separated by a delimiter. The maxInts
attributes determines how
many integers are allowed. The integer and timestamp are separated by a space character. The
timestamp is the number of milliseconds since 1st January 1970 (Epoch time)AdminCustomerTag.DECIMAL_TYPE
: The value is a decimal.AdminCustomerTag.DATE_TYPE
: The value is a date.AdminCustomerTag.BOOLEAN_TYPE
: The value is a boolean and so must contain
the string true
or false
AdminCustomerTag.AGE_TYPE
: The tag value is a date. When creating
expressions you can define the value to be greater or less than a length of time (in seconds)
rather than comparing it to a specific date.private int operator
private java.lang.String value
private java.lang.String customerValue
value
attribute when
evaluating the expression variable.private int order
private int andOr
private int groupOrder
private int groupAndOr
public AdminExpressionVariable()
public AdminExpressionVariable(com.workingdogs.village.Record vr, com.konakart.db.KKCriteria c) throws com.workingdogs.village.DataSetException
vr
- Record containing datac
- Criteria containing column namescom.workingdogs.village.DataSetException
- an unexpected exception due to data in Torque (the database layer)public java.lang.String toString()
toString
in class java.lang.Object
public boolean evaluate() throws KKAdminException
value
attribute with the
customerValue
attribute using the operator
attribute. False is
returned if any of the values are null.
Not all operators are valid for all customer tag types. The valid operators for each customer tag type are:
KKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareStrings(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareBooleans(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareMultiInt(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareMultiIntPlusTime(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareInts(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareDates(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareAge(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected boolean compareDecimals(int oper) throws KKAdminException
oper
- the operKKAdminException
- an unexpected exception in the KonaKart Admin engine unexpected exception in the KonaKart Admin Engineprotected java.lang.String getOperatorName(int oper)
oper
- the operpublic int getId()
public void setId(int id)
id
- the id to setpublic int getCustomerTagId()
public void setCustomerTagId(int customerTagId)
customerTagId
- the customerTagId to setpublic int getExpressionId()
public void setExpressionId(int expressionId)
expressionId
- the expressionId to setpublic int getType()
public void setType(int type)
type
- the type to setpublic int getOperator()
public void setOperator(int operator)
operator
- the operator to setpublic java.lang.String getValue()
public void setValue(java.lang.String value)
value
- the value to setpublic int getOrder()
public void setOrder(int order)
order
- the order to setpublic int getAndOr()
public void setAndOr(int andOr)
andOr
- the andOr to setpublic int getGroupOrder()
public void setGroupOrder(int groupOrder)
groupOrder
- the groupOrder to setpublic int getGroupAndOr()
public void setGroupAndOr(int groupAndOr)
groupAndOr
- the groupAndOr to setpublic java.lang.String getCustomerValue()
public void setCustomerValue(java.lang.String customerValue)
customerValue
- the customerValue to setCopyright © 2018 DS Data Systems UK Ltd.