[text] idk

Viewer

  1.  
  2. // Licensed to the Software Freedom Conservancy (SFC) under one
  3. // or more contributor license agreements.  See the NOTICE file
  4. // distributed with this work for additional information
  5. // regarding copyright ownership.  The SFC licenses this file
  6. // to you under the Apache License, Version 2.0 (the
  7. // "License"); you may not use this file except in compliance
  8. // with the License.  You may obtain a copy of the License at
  9. //
  10. //   http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing,
  13. // software distributed under the License is distributed on an
  14. // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. // KIND, either express or implied.  See the License for the
  16. // specific language governing permissions and limitations
  17. // under the License.
  18.  
  19. /*
  20.  * Copied here by jBrowserDriver to support Selenium 3 and 4. Selenium 4 does not have this file.
  21.  */
  22.  
  23. package org.openqa.selenium;
  24.  
  25. /**
  26.  * Represents the type of a new browser window that may be created.
  27.  */
  28. public enum WindowType {
  29.  
  30.   WINDOW ("window"),
  31.   TAB ("tab"),
  32.   ;
  33.  
  34.   private String text;
  35.   
  36.   WindowType(String text) {
  37.     this.text = text;
  38.   }
  39.  
  40.   @Override
  41.   public String toString() {
  42.     return String.valueOf(text);
  43.   }
  44.  
  45.   public static WindowType fromString(String text) {
  46.     if (text != null) {
  47.       for (WindowType b : WindowType.values()) {
  48.         if (text.equalsIgnoreCase(b.text)) {
  49.           return b;
  50.         }
  51.       }
  52.     }
  53.     return null;
  54.   }
  55. }

Editor

You can edit this paste and save as new:


File Description
  • idk
  • Paste Code
  • 01 Mar-2021
  • 1.5 Kb
You can Share it: