@Test public void testPortFromString() { assertNull(BaleenWebApi.getPortFromString("test")); assertNull(BaleenWebApi.getPortFromString("-1")); assertNull(BaleenWebApi.getPortFromString("123456789")); assertEquals(new Integer(1234), BaleenWebApi.getPortFromString("1234")); }
public static Integer getPortFromString(String port) { if (port != null) { Integer p = Ints.tryParse(port); if (p != null && p > 0 && p < 65536) { return p; } } return null; }
BaleenWebApi extends AbstractBaleenComponent { public static Integer getPortFromString(String port) { if (port != null) { Integer p = Ints.tryParse(port); if (p != null && p > 0 && p < 65536) { return p; } } return null; } }
BaleenWebApi extends AbstractBaleenComponent { public static Integer getPortFromString(String port) { if (port != null) { Integer p = Ints.tryParse(port); if (p != null && p > 0 && p < 65536) { return p; } } return null; } BaleenWebApi(BaleenManager baleenManager); }
BaleenWebApi extends AbstractBaleenComponent { public static Integer getPortFromString(String port) { if (port != null) { Integer p = Ints.tryParse(port); if (p != null && p > 0 && p < 65536) { return p; } } return null; } BaleenWebApi(BaleenManager baleenManager); @Override void configure(Configuration configuration); void configure(
      String host,
      int suppliedPort,
      String webResourceRoot,
      WebAuthConfig authConfig,
      List<Object> wars); static int getPort(int suppliedPort); static Integer getPortFromString(String port); @Override void start(); @Override void stop(); static void main(String[] args); }
BaleenWebApi extends AbstractBaleenComponent { public static Integer getPortFromString(String port) { if (port != null) { Integer p = Ints.tryParse(port); if (p != null && p > 0 && p < 65536) { return p; } } return null; } BaleenWebApi(BaleenManager baleenManager); @Override void configure(Configuration configuration); void configure(
      String host,
      int suppliedPort,
      String webResourceRoot,
      WebAuthConfig authConfig,
      List<Object> wars); static int getPort(int suppliedPort); static Integer getPortFromString(String port); @Override void start(); @Override void stop(); static void main(String[] args); static final String CONFIG_BASE; static final String CONFIG_PORT; static final String CONFIG_HOST; static final String CONFIG_WEB_ROOT; @SuppressWarnings("squid:S1313" /* This is a default, the host is configurable */)
  static final String DEFAULT_HOST; static final int DEFAULT_PORT; }