Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- http://joxi.ru/823k1x0U6ELzG2
- /*
- т к пейдж = пейдж-объект
- та все методы пейджа реализуй как не static
- */
- *************************************
- public class WaitFor<V> {
- /*
- когда применять V
- а когда - T
- http://stackoverflow.com/questions/6008241/java-generics-e-and-t-what-is-the-difference
- когда типизируешь generic-типом класс - то T (T is meant to be a Type)
- а когда речь идет о типизации значения, возвращаемого методом - V (V is Value (as a return value or mapped value))
- т е - тут = T is meant to be a Type
- а вот в public <V> V run(Command<V> command) - как раз V правильно
- т к V - это тип возвращаемого значения
- */
- **************************************
- public V until(Condition<V>... conditions) {
- V current = null;
- for (Condition<V> condition:conditions) {
- current = until(condition, Configuration.timeout);
- if (current == null) {
- return null;
- }
- }
- return current;
- }
- /*
- можно убирать
- if (current == null) {
- return null;
- }
- until - или вернет что-то значащее, или бросит экспшен
- */
Advertisement
Add Comment
Please, Sign In to add comment