is there a equivalent of StringBuilder for boolean in java? -
i want custom functions modify / toggle boolean variable. let's have code like
if (ok2continue) { findandclick(new string[]{"id", "menubutton"});} if (ok2continue) { findandclick(new string[]{"src", ".*homeicon_calendar.*"}); } if (ok2continue) { findandclick(new string[]{"src", ".*cycle_templates.*"}); i want make sure flow of execution stops once of findandclick functions toggles variable ok2continue
i managed functions modify string variable using stringbuilder.
can same boolean type of variable?
push code own method, , use return:
if (findandclick(new string[]{"id", "menubutton"})) return; if (findandclick(new string[]{"src", ".*homeicon_calendar.*"})) return; if (findandclick(new string[]{"src", ".*cycle_templates.*"})) return; given method calls same, use loop:
string[][] buttons = { {"id", "menubutton"}, {"src", ".*homeicon_calendar.*"}, {"src", ".*cycle_templates.*"}, }; (string[] button: buttons) { if (findandclick(button)) return; } you might or might not find more readable.
Comments
Post a Comment