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 booleancontainsbooleanignoreCaseStringjsIsTrueScriptstatic org.apache.logging.log4j.LoggerLOGintmaxPagesSessionsessionbooleantestBefore
-
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 booleandoTestBeforeProcessingPage()Returns true if the condition's isTrue method should be called before processing a page (versus after).voideachPage()Called after each scroll.booleaneachRow(Table.Row row)Called for each row, also gives the StopCondition a chance to skip rows.voidincrementPageCount()voidinitialize()initialize will be called once before iterating through the pages of a Table.abstract booleaninnerIsTrue()booleanisTrue()Returns true if the Condition is satisfied.booleanisTrue(String actual, String expected)Return true if actual "equals" expected, where "equals" takes into account the ignoreCase and contains settings.voidsetJavascriptIsTrueScript(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:ConditionReturns true if the Condition is satisfied.
-
innerIsTrue
public abstract boolean innerIsTrue()
-
initialize
public void initialize()
Description copied from interface:Table.StopConditioninitialize will be called once before iterating through the pages of a Table.- Specified by:
initializein interfaceTable.StopCondition
-
doTestBeforeProcessingPage
public boolean doTestBeforeProcessingPage()
Description copied from interface:Table.StopConditionReturns true if the condition's isTrue method should be called before processing a page (versus after).- Specified by:
doTestBeforeProcessingPagein 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.StopConditionCalled after each scroll.- Specified by:
eachPagein interfaceTable.StopCondition
-
eachRow
public boolean eachRow(Table.Row row)
Description copied from interface:Table.StopConditionCalled for each row, also gives the StopCondition a chance to skip rows. Return true to include the row, false to skip it.- Specified by:
eachRowin 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()
-
-