Java Assert assertValidBrowserType(int aBrowserType)

Here you can find the source of assertValidBrowserType(int aBrowserType)

Description

assert Valid Browser Type

License

Open Source License

Declaration

private static void assertValidBrowserType(int aBrowserType) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from  ww w .  j  av a2 s.  c  om*/
     * This forces the browser to go through the carrier WAP gateway
     * to access the Internet. Only use the WAP Browser if:
     * <ul>
     * <li>You need to identify the carrier network that the user is coming
     * from (the WAP gateway will add this info to the header)</li>
     * <li>You want to access a site where the user will be able to stream
     * content using the RTSP protocol</li>
     * </ul>
     * Please note that as there can only be one browser of this type on the
     * device, it's not specified here if the underlying transport is of type
     * WAP(UDP) or WPTCP(TCP).
     */
    public static final int BROWSER_WAP = 0;
    /**
     * If the user is a corporate user, this forces the browser
     * to go through their corporate BES (behind their IT firewall). Only
     * use the BES Browser if:
     * <ul>
     * <li>The website you are addressing is inside the corporate firewall</li>
     * <li>The BIS Browser service is not available</li>
     */
    public static final int BROWSER_COMPANY = 2;
    /**
     * This forces the browser to use the WiFi access point.
     * <p>
     * <b>This method only works if called on a device with WiFi radio parts.
     * It's the callers responsiblity to ensure that the device is connected
     * to a WiFi network before using the browser</b>
     */
    public static final int BROWSER_WIFI = 3;
    /**
     * This forces the browser to use the Unite gateway.
     * <p>
     * It's the callers responsiblity to ensure that the device is connected
     * to a Unite network before using the browser</b>
     */
    public static final int BROWSER_UNITE = 4;

    private static void assertValidBrowserType(int aBrowserType) {
        switch (aBrowserType) {
        case BROWSER_WAP:
        case BROWSER_COMPANY:
        case BROWSER_WIFI:
        case BROWSER_UNITE:
            //OK!
            return;
        }
        throw new IllegalArgumentException("Not a valid browser type");
    }
}

Related

  1. assertTesting()
  2. assertThrows(Class exception, Runnable action)
  3. assertTwoParameters(Class clz, String method, double... args)
  4. assertUnreachable()
  5. assertValid(int piece)
  6. assertValidColumnName(String name)
  7. assertValidItemName(String itemName)
  8. assertValidKeys(Iterable keys)
  9. assertValidRange(String name, double value, double min, double max)