Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for fromParts (0.07 sec)

  1. android/guava-tests/test/com/google/common/net/HostAndPortTest.java

      public void testFromParts() {
        HostAndPort hp = HostAndPort.fromParts("gmail.com", 81);
        assertEquals("gmail.com", hp.getHost());
        assertTrue(hp.hasPort());
        assertEquals(81, hp.getPort());
    
        assertThrows(IllegalArgumentException.class, () -> HostAndPort.fromParts("gmail.com:80", 81));
    
        assertThrows(IllegalArgumentException.class, () -> HostAndPort.fromParts("gmail.com", -1));
      }
    
      public void testFromHost() {
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Oct 21 15:41:36 UTC 2024
    - 9.4K bytes
    - Viewed (0)
  2. guava/src/com/google/common/net/HostAndPort.java

       * @throws IllegalArgumentException if {@code host} contains a port number, or {@code port} is out
       *     of range.
       */
      public static HostAndPort fromParts(String host, int port) {
        checkArgument(isValidPort(port), "Port out of range: %s", port);
        HostAndPort parsedHost = fromString(host);
        checkArgument(!parsedHost.hasPort(), "Host has a port: %s", host);
    Registered: Fri Nov 01 12:43:10 UTC 2024
    - Last Modified: Mon Jul 22 22:02:22 UTC 2024
    - 11.3K bytes
    - Viewed (0)
Back to top