julia_v_iluhina

Untitled

Nov 29th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.44 KB | None | 0 0
  1. http://joxi.ru/823k1x0U6ELzG2
  2. /*
  3.     т к пейдж = пейдж-объект
  4.  
  5.     та все методы пейджа реализуй как не static
  6. */
  7. *************************************
  8. public class WaitFor<V> {
  9. /*
  10.     когда применять V
  11.     а когда  - T
  12.  
  13.     http://stackoverflow.com/questions/6008241/java-generics-e-and-t-what-is-the-difference
  14.  
  15.     когда типизируешь generic-типом класс - то T (T is meant to be a Type)
  16.  
  17.     а когда речь идет о типизации значения, возвращаемого методом -  V (V is Value (as a return value or mapped value))
  18.  
  19.     т е - тут = T is meant to be a Type
  20.  
  21.     а вот в   public <V> V run(Command<V> command) - как раз V правильно
  22.     т к V - это тип возвращаемого значения
  23. */
  24. **************************************
  25.     public V until(Condition<V>... conditions) {
  26.         V current = null;
  27.  
  28.         for (Condition<V> condition:conditions) {
  29.             current = until(condition, Configuration.timeout);
  30.             if (current == null) {
  31.                 return null;
  32.             }
  33.         }
  34.         return current;
  35.     }
  36. /*
  37.     можно убирать
  38.              if (current == null) {
  39.                  return null;
  40.              }
  41.     until - или вернет что-то значащее, или бросит экспшен
  42. */
Advertisement
Add Comment
Please, Sign In to add comment