Class 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 Detail

      • LOG

        public static final org.apache.logging.log4j.Logger LOG
    • 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,
                                 Object targetValue)
      • PropertyCondition

        public PropertyCondition​(String propertyName,
                                 boolean includeChangeCount)
      • PropertyCondition

        public PropertyCondition​(Object targetValue,
                                 String... propertyNames)
      • PropertyCondition

        public PropertyCondition​(com.rs.seagull.emulator.api.impl.ModelMemberHolder model)
      • PropertyCondition

        public PropertyCondition()
    • Method Detail

      • getPropertyName

        @Deprecated
        public String getPropertyName()
        Deprecated.
        will return null is there are no property names otherwise returns the alphabetically first property name
        Returns 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()
      • isTrue

        public abstract boolean isTrue()
        Description copied from interface: Condition
        Returns true if the Condition is satisfied.
        Returns:
        true if the Condition is satisfied.