Package com.rs.seagull.emulator.api
Class PropertyCondition
- java.lang.Object
-
- com.rs.seagull.emulator.api.AbstractCondition
-
- com.rs.seagull.emulator.api.PropertyCondition
-
- All Implemented Interfaces:
Condition
public abstract class PropertyCondition extends AbstractCondition
An implementation of Condition that includes model property names which indicates when a waitFor should 'wake up' to evaluate the condition. For example, say there's a condition to check for the cursor being at a particular point, then the property would be "CursorPoint". In addition, a targetValue may be optionally supplied. If it is, then the property's changed value (newValue) must equal the targetValue for the condition to be evaluated.- Version:
- $Id$
-
-
Field Summary
Fields Modifier and Type Field Description static org.apache.logging.log4j.Logger
LOG
-
Fields inherited from class com.rs.seagull.emulator.api.AbstractCondition
semaphore
-
-
Constructor Summary
Constructors Constructor Description PropertyCondition()
PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model)
PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, Object targetValue, String... propertyNames)
PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, String propertyName)
PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, String... propertyNames)
PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, String propertyName, Object targetValue)
PropertyCondition(Object targetValue, String... propertyNames)
PropertyCondition(String propertyName)
PropertyCondition(String... propertyNames)
PropertyCondition(String propertyName, boolean includeChangeCount)
PropertyCondition(String propertyName, Object targetValue)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
cleanUp()
BareSession
getHostSession()
String
getPropertyName()
Deprecated.will returnnull
is there are no property names otherwise returns the alphabetically first property nameSet<String>
getPropertyNames()
Returns a collection of model properties which, when changed, causes the condition to be evaluated.String[]
getPropertyNamesAsArray()
Object
getTargetValue()
abstract boolean
isTrue()
Returns true if the Condition is satisfied.void
setTrigger(Semaphore semaphore, BareSession session)
String
toString()
-
-
-
Constructor Detail
-
PropertyCondition
public PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, String propertyName)
-
PropertyCondition
public PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, String... propertyNames)
-
PropertyCondition
public PropertyCondition(String propertyName)
-
PropertyCondition
public PropertyCondition(String... propertyNames)
-
PropertyCondition
public PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, String propertyName, Object targetValue)
-
PropertyCondition
public PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model, Object targetValue, String... propertyNames)
-
PropertyCondition
public PropertyCondition(String propertyName, boolean includeChangeCount)
-
PropertyCondition
public PropertyCondition(com.rs.seagull.emulator.api.impl.ModelMemberHolder model)
-
PropertyCondition
public PropertyCondition()
-
-
Method Detail
-
getPropertyName
@Deprecated public String getPropertyName()
Deprecated.will returnnull
is there are no property names otherwise returns the alphabetically first property nameReturns a model property that, when changed, causes the condition to be evaluated. See available property names in HostModel and HostInteraction. Note that if a Condition does not supply a property name, then the condition will be evaluated every time *any* property changes.- Returns:
- the name of a HostModel property
-
getPropertyNames
public Set<String> getPropertyNames()
Returns a collection of model properties which, when changed, causes the condition to be evaluated. See available property names in HostModel and HostInteraction. Note that if a Condition does not supply any property name, then the condition will be evaluated every time *any* property changes.- Returns:
- the name of a HostModel property
-
getPropertyNamesAsArray
public String[] getPropertyNamesAsArray()
-
getTargetValue
public Object getTargetValue()
-
setTrigger
public void setTrigger(Semaphore semaphore, BareSession session)
- Specified by:
setTrigger
in classAbstractCondition
-
cleanUp
public void cleanUp()
- Overrides:
cleanUp
in classAbstractCondition
-
getHostSession
public BareSession getHostSession()
-
isTrue
public abstract boolean isTrue()
Description copied from interface:Condition
Returns true if the Condition is satisfied.- Returns:
- true if the Condition is satisfied.
-
-