Package com.rs.seagull.emulator.api
Class StopConditions.StopConditionAdapter
- java.lang.Object
-
- com.rs.seagull.emulator.api.StopConditions.StopConditionAdapter
-
- All Implemented Interfaces:
Condition
,Table.StopCondition
- Direct Known Subclasses:
StopConditions.EndMarkerStopCondition
- Enclosing class:
- StopConditions
public abstract static class StopConditions.StopConditionAdapter extends Object implements Table.StopCondition
An abstract superclass for most concrete StopConditions.
-
-
Field Summary
Fields Modifier and Type Field Description boolean
contains
boolean
ignoreCase
String
jsIsTrueScript
static org.apache.logging.log4j.Logger
LOG
int
maxPages
Session
session
boolean
testBefore
-
Constructor Summary
Constructors Constructor Description StopConditionAdapter(Session session)
StopConditionAdapter(Session session, boolean ignoreCase, boolean testBefore, boolean contains)
StopConditionAdapter(Session session, boolean ignoreCase, boolean testBefore, boolean contains, int maxPages)
StopConditionAdapter(Session session, boolean testBefore, int maxPages)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
doTestBeforeProcessingPage()
Returns true if the condition's isTrue method should be called before processing a page (versus after).void
eachPage()
Called after each scroll.boolean
eachRow(Table.Row row)
Called for each row, also gives the StopCondition a chance to skip rows.void
incrementPageCount()
void
initialize()
initialize will be called once before iterating through the pages of a Table.abstract boolean
innerIsTrue()
boolean
isTrue()
Returns true if the Condition is satisfied.boolean
isTrue(String actual, String expected)
Return true if actual "equals" expected, where "equals" takes into account the ignoreCase and contains settings.void
setJavascriptIsTrueScript(String script)
Allow the isTrue method to be implemented in javascript, which allows for extensibility.
-
-
-
Field Detail
-
LOG
public static final org.apache.logging.log4j.Logger LOG
-
session
public final Session session
-
ignoreCase
public final boolean ignoreCase
-
testBefore
public final boolean testBefore
-
contains
public final boolean contains
-
jsIsTrueScript
public String jsIsTrueScript
-
maxPages
public final int maxPages
-
-
Constructor Detail
-
StopConditionAdapter
public StopConditionAdapter(Session session, boolean ignoreCase, boolean testBefore, boolean contains)
-
StopConditionAdapter
public StopConditionAdapter(Session session, boolean testBefore, int maxPages)
-
StopConditionAdapter
public StopConditionAdapter(Session session)
-
StopConditionAdapter
public StopConditionAdapter(Session session, boolean ignoreCase, boolean testBefore, boolean contains, int maxPages)
-
-
Method Detail
-
isTrue
public boolean isTrue()
Description copied from interface:Condition
Returns true if the Condition is satisfied.
-
innerIsTrue
public abstract boolean innerIsTrue()
-
initialize
public void initialize()
Description copied from interface:Table.StopCondition
initialize will be called once before iterating through the pages of a Table.- Specified by:
initialize
in interfaceTable.StopCondition
-
doTestBeforeProcessingPage
public boolean doTestBeforeProcessingPage()
Description copied from interface:Table.StopCondition
Returns true if the condition's isTrue method should be called before processing a page (versus after).- Specified by:
doTestBeforeProcessingPage
in interfaceTable.StopCondition
- Returns:
- whether or not to call the condition's isTrue method before processing the page
-
eachPage
public void eachPage()
Description copied from interface:Table.StopCondition
Called after each scroll.- Specified by:
eachPage
in interfaceTable.StopCondition
-
eachRow
public boolean eachRow(Table.Row row)
Description copied from interface:Table.StopCondition
Called for each row, also gives the StopCondition a chance to skip rows. Return true to include the row, false to skip it.- Specified by:
eachRow
in interfaceTable.StopCondition
- Parameters:
row
- the current row to check- Returns:
- whether or not to include the row
-
setJavascriptIsTrueScript
public void setJavascriptIsTrueScript(String script)
Allow the isTrue method to be implemented in javascript, which allows for extensibility. During execution of the script, hostSession is the active Session and stopCondition is this StopConditionAdapter.- Parameters:
script
- source script that implements isTrue and "returns" (ends with) a boolean.
-
isTrue
public boolean isTrue(String actual, String expected)
Return true if actual "equals" expected, where "equals" takes into account the ignoreCase and contains settings.- Parameters:
actual
- the actual valueexpected
- the expected value- Returns:
- true if actual "equals" expected
-
incrementPageCount
public void incrementPageCount()
-
-