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 class
Condition.DateConstraint
static class
Condition.Operator
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DateConstraint_Prop
static java.lang.String
IgnoreCase_Prop
static java.lang.String
Negated_Prop
static java.lang.String
Operator_Prop
static java.lang.String
PropertyName_Prop
static java.lang.String
Value_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 Condition
clone()
Standard clone implementation (to get co-variant return type).boolean
equals(java.lang.Object anObj)
Standard equals implementation.Condition
fromXML(RXArchiver anArchiver, RXElement anElement)
XML Unarchival.Condition.DateConstraint
getDateConstraint()
Returns date constraint.Condition.DateConstraint
getDateConstraintDefault()
Returns the date constraint default.long
getDateConstraintMultiplier()
Returns the date constraint multiplier.boolean
getIgnoreCase()
Returns whether condition ignores case (string types).java.util.List<java.lang.String>
getJSONKeys()
RMJSONArchiver.GetKeys method.Condition.Operator
getOperator()
Returns the operator.static java.util.List<Condition.Operator>
getOperators(Property.Type aType)
Returns the valid operators for a given property type.java.lang.String
getPropertyName()
Returns the property name.java.lang.Object
getValue()
Returns the value.boolean
getValue(Entity anEntity, java.lang.Object anObj)
Returns the value of evaluating this condition on given object.boolean
isNegated()
Returns whether condition is negated.void
setDateConstraint(Condition.DateConstraint aDateConstraint)
Sets the date constraint.void
setIgnoreCase(boolean aValue)
Sets whether condition ignores case (string types).void
setNegated(boolean aValue)
Sets whether condition is negated.void
setOperator(Condition.Operator anOperator)
Sets the operator.void
setPropertyName(java.lang.String aValue)
Sets the property name.void
setValue(java.lang.Object aValue)
Sets the value.java.lang.String
toString()
Returns a string for condition.RXElement
toXML(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:
equals
in classjava.lang.Object
-
clone
public Condition clone()
Standard clone implementation (to get co-variant return type).- Overrides:
clone
in classRMListenerList
-
toXML
public RXElement toXML(RXArchiver anArchiver)
XML Archival.- Specified by:
toXML
in interfaceArchivable
-
fromXML
public Condition fromXML(RXArchiver anArchiver, RXElement anElement)
XML Unarchival.- Specified by:
fromXML
in interfaceArchivable
-
getJSONKeys
public java.util.List<java.lang.String> getJSONKeys()
RMJSONArchiver.GetKeys method.- Specified by:
getJSONKeys
in interfaceRMJSONArchiver.GetKeys
-
-