Class Condition
- java.lang.Object
-
- com.inductiveautomation.rm.base.RMListenerList
-
- com.inductiveautomation.rm.base.RMObject
-
- com.inductiveautomation.snap.data.Condition
-
- All Implemented Interfaces:
Archivable,RMJSONArchiver.GetKeys,RMPropertyChanger,java.lang.Cloneable
- Direct Known Subclasses:
ConditionList
public class Condition extends RMObject implements RMJSONArchiver.GetKeys, Archivable
Represents a condition that is part of a SQL where clause.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCondition.DateConstraintstatic classCondition.Operator
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDateConstraint_Propstatic java.lang.StringIgnoreCase_Propstatic java.lang.StringNegated_Propstatic java.lang.StringOperator_Propstatic java.lang.StringPropertyName_Propstatic java.lang.StringValue_Prop
-
Constructor Summary
Constructors Constructor Description Condition()Creates a new select condition.Condition(java.lang.String aPropertyName, Condition.Operator anOperator, java.lang.Object aValue)Creates a new select condition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Conditionclone()Standard clone implementation (to get co-variant return type).booleanequals(java.lang.Object anObj)Standard equals implementation.ConditionfromXML(RXArchiver anArchiver, RXElement anElement)XML Unarchival.Condition.DateConstraintgetDateConstraint()Returns date constraint.Condition.DateConstraintgetDateConstraintDefault()Returns the date constraint default.longgetDateConstraintMultiplier()Returns the date constraint multiplier.booleangetIgnoreCase()Returns whether condition ignores case (string types).java.util.List<java.lang.String>getJSONKeys()RMJSONArchiver.GetKeys method.Condition.OperatorgetOperator()Returns the operator.static java.util.List<Condition.Operator>getOperators(Property.Type aType)Returns the valid operators for a given property type.java.lang.StringgetPropertyName()Returns the property name.java.lang.ObjectgetValue()Returns the value.booleangetValue(Entity anEntity, java.lang.Object anObj)Returns the value of evaluating this condition on given object.booleanisNegated()Returns whether condition is negated.voidsetDateConstraint(Condition.DateConstraint aDateConstraint)Sets the date constraint.voidsetIgnoreCase(boolean aValue)Sets whether condition ignores case (string types).voidsetNegated(boolean aValue)Sets whether condition is negated.voidsetOperator(Condition.Operator anOperator)Sets the operator.voidsetPropertyName(java.lang.String aValue)Sets the property name.voidsetValue(java.lang.Object aValue)Sets the value.java.lang.StringtoString()Returns a string for condition.RXElementtoXML(RXArchiver anArchiver)XML Archival.-
Methods inherited from class com.inductiveautomation.rm.base.RMObject
addPropertyChangeListener, animUpdate, firePropertyChange, firePropertyChange, firePropertyChange, getPCEvent, removePropertyChangeListener, sendPropertyChange
-
Methods inherited from class com.inductiveautomation.rm.base.RMListenerList
addListener, getListener, getListenerCount, getListenerCount, getListenerList, getListeners, hasListeners, removeListener
-
-
-
-
Field Detail
-
PropertyName_Prop
public static final java.lang.String PropertyName_Prop
- See Also:
- Constant Field Values
-
Operator_Prop
public static final java.lang.String Operator_Prop
- See Also:
- Constant Field Values
-
Value_Prop
public static final java.lang.String Value_Prop
- See Also:
- Constant Field Values
-
Negated_Prop
public static final java.lang.String Negated_Prop
- See Also:
- Constant Field Values
-
IgnoreCase_Prop
public static final java.lang.String IgnoreCase_Prop
- See Also:
- Constant Field Values
-
DateConstraint_Prop
public static final java.lang.String DateConstraint_Prop
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Condition
public Condition()
Creates a new select condition.
-
Condition
public Condition(java.lang.String aPropertyName, Condition.Operator anOperator, java.lang.Object aValue)Creates a new select condition.
-
-
Method Detail
-
getPropertyName
public java.lang.String getPropertyName()
Returns the property name.
-
setPropertyName
public void setPropertyName(java.lang.String aValue)
Sets the property name.
-
getOperator
public Condition.Operator getOperator()
Returns the operator.
-
setOperator
public void setOperator(Condition.Operator anOperator)
Sets the operator.
-
getValue
public java.lang.Object getValue()
Returns the value.
-
setValue
public void setValue(java.lang.Object aValue)
Sets the value.
-
isNegated
public boolean isNegated()
Returns whether condition is negated.
-
setNegated
public void setNegated(boolean aValue)
Sets whether condition is negated.
-
getIgnoreCase
public boolean getIgnoreCase()
Returns whether condition ignores case (string types).
-
setIgnoreCase
public void setIgnoreCase(boolean aValue)
Sets whether condition ignores case (string types).
-
getDateConstraint
public Condition.DateConstraint getDateConstraint()
Returns date constraint.
-
setDateConstraint
public void setDateConstraint(Condition.DateConstraint aDateConstraint)
Sets the date constraint.
-
getDateConstraintDefault
public Condition.DateConstraint getDateConstraintDefault()
Returns the date constraint default.
-
getDateConstraintMultiplier
public long getDateConstraintMultiplier()
Returns the date constraint multiplier.
-
getOperators
public static java.util.List<Condition.Operator> getOperators(Property.Type aType)
Returns the valid operators for a given property type.
-
getValue
public boolean getValue(@Nonnull Entity anEntity, java.lang.Object anObj)Returns the value of evaluating this condition on given object.
-
equals
public boolean equals(java.lang.Object anObj)
Standard equals implementation.- Overrides:
equalsin classjava.lang.Object
-
clone
public Condition clone()
Standard clone implementation (to get co-variant return type).- Overrides:
clonein classRMListenerList
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML Archival.- Specified by:
toXMLin interfaceArchivable
-
fromXML
public Condition fromXML(RXArchiver anArchiver, RXElement anElement)
XML Unarchival.- Specified by:
fromXMLin interfaceArchivable
-
getJSONKeys
public java.util.List<java.lang.String> getJSONKeys()
RMJSONArchiver.GetKeys method.- Specified by:
getJSONKeysin interfaceRMJSONArchiver.GetKeys
-
-