Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for getPortOrDefault (0.09 sec)

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

      }
    
      public void testGetPortOrDefault() {
        assertEquals(80, HostAndPort.fromString("host:80").getPortOrDefault(123));
        assertEquals(123, HostAndPort.fromString("host").getPortOrDefault(123));
      }
    
      public void testHashCodeAndEquals() {
        HostAndPort hpNoPort1 = HostAndPort.fromString("foo::123");
    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

       */
      public int getPort() {
        checkState(hasPort());
        return port;
      }
    
      /** Returns the current port number, with a default if no port is defined. */
      public int getPortOrDefault(int defaultPort) {
        return hasPort() ? port : defaultPort;
      }
    
      /**
       * Build a HostAndPort instance from separate host and port values.
       *
    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