Home / Class/ HostPort Class — netty Architecture

HostPort Class — netty Architecture

Architecture documentation for the HostPort class in OpenSslClientSessionCache.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  2acb52ea_ab09_24bc_f09d_f5f486826eeb["HostPort"]
  8932cd5d_eee0_412c_f52c_ecf04a164041["OpenSslClientSessionCache.java"]
  2acb52ea_ab09_24bc_f09d_f5f486826eeb -->|defined in| 8932cd5d_eee0_412c_f52c_ecf04a164041
  b70aafa3_ea04_2827_e08c_e3b98fef751b["HostPort()"]
  2acb52ea_ab09_24bc_f09d_f5f486826eeb -->|method| b70aafa3_ea04_2827_e08c_e3b98fef751b
  314da6fc_78b9_d7ea_dc94_ac49adacf9d0["hashCode()"]
  2acb52ea_ab09_24bc_f09d_f5f486826eeb -->|method| 314da6fc_78b9_d7ea_dc94_ac49adacf9d0
  c2978cd6_09b2_3ccc_3486_00410f16b317["equals()"]
  2acb52ea_ab09_24bc_f09d_f5f486826eeb -->|method| c2978cd6_09b2_3ccc_3486_00410f16b317
  79c812a5_c29c_3f92_3989_74f4f8a88136["String()"]
  2acb52ea_ab09_24bc_f09d_f5f486826eeb -->|method| 79c812a5_c29c_3f92_3989_74f4f8a88136

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/OpenSslClientSessionCache.java lines 154–187

    private static final class HostPort {
        private final int hash;
        private final String host;
        private final int port;

        HostPort(String host, int port) {
            this.host = host;
            this.port = port;
            // Calculate a hashCode that does ignore case.
            this.hash = 31 * AsciiString.hashCode(host) + port;
        }

        @Override
        public int hashCode() {
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (!(obj instanceof HostPort)) {
                return false;
            }
            HostPort other = (HostPort) obj;
            return port == other.port && host.equalsIgnoreCase(other.host);
        }

        @Override
        public String toString() {
            return "HostPort{" +
                    "host='" + host + '\'' +
                    ", port=" + port +
                    '}';
        }
    }

Frequently Asked Questions

What is the HostPort class?
HostPort is a class in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/OpenSslClientSessionCache.java.
Where is HostPort defined?
HostPort is defined in handler/src/main/java/io/netty/handler/ssl/OpenSslClientSessionCache.java at line 154.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free