Home / Class/ Socks5AddressType Class — netty Architecture

Socks5AddressType Class — netty Architecture

Architecture documentation for the Socks5AddressType class in Socks5AddressType.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  17ea7791_49e9_e971_3266_f6709874f222["Socks5AddressType"]
  f4be74b8_02f2_f7b4_cdf9_2ea8cdac1fb1["Socks5AddressType.java"]
  17ea7791_49e9_e971_3266_f6709874f222 -->|defined in| f4be74b8_02f2_f7b4_cdf9_2ea8cdac1fb1
  0d7226d5_daf9_18a5_2b99_52b086f25a84["Socks5AddressType()"]
  17ea7791_49e9_e971_3266_f6709874f222 -->|method| 0d7226d5_daf9_18a5_2b99_52b086f25a84
  bc7961ce_b9a3_7b10_0a03_31e052738129["byteValue()"]
  17ea7791_49e9_e971_3266_f6709874f222 -->|method| bc7961ce_b9a3_7b10_0a03_31e052738129
  5b686c7b_3ccc_550e_d796_4e025691be09["hashCode()"]
  17ea7791_49e9_e971_3266_f6709874f222 -->|method| 5b686c7b_3ccc_550e_d796_4e025691be09
  b38cbcd9_33a3_4000_9602_452f46f857cf["equals()"]
  17ea7791_49e9_e971_3266_f6709874f222 -->|method| b38cbcd9_33a3_4000_9602_452f46f857cf
  632c3b71_2728_4833_8747_c5574dba8c09["compareTo()"]
  17ea7791_49e9_e971_3266_f6709874f222 -->|method| 632c3b71_2728_4833_8747_c5574dba8c09
  aba6558a_90b8_6d98_ff28_b31f7b5d1061["String()"]
  17ea7791_49e9_e971_3266_f6709874f222 -->|method| aba6558a_90b8_6d98_ff28_b31f7b5d1061

Relationship Graph

Source Code

codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/Socks5AddressType.java lines 24–87

public class Socks5AddressType implements Comparable<Socks5AddressType> {

    public static final Socks5AddressType IPv4 = new Socks5AddressType(0x01, "IPv4");
    public static final Socks5AddressType DOMAIN = new Socks5AddressType(0x03, "DOMAIN");
    public static final Socks5AddressType IPv6 = new Socks5AddressType(0x04, "IPv6");

    public static Socks5AddressType valueOf(byte b) {
        switch (b) {
        case 0x01:
            return IPv4;
        case 0x03:
            return DOMAIN;
        case 0x04:
            return IPv6;
        }

        return new Socks5AddressType(b);
    }

    private final byte byteValue;
    private final String name;
    private String text;

    public Socks5AddressType(int byteValue) {
        this(byteValue, "UNKNOWN");
    }

    public Socks5AddressType(int byteValue, String name) {
        this.name = ObjectUtil.checkNotNull(name, "name");
        this.byteValue = (byte) byteValue;
    }

    public byte byteValue() {
        return byteValue;
    }

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

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Socks5AddressType)) {
            return false;
        }

        return byteValue == ((Socks5AddressType) obj).byteValue;
    }

    @Override
    public int compareTo(Socks5AddressType o) {
        return byteValue - o.byteValue;
    }

    @Override
    public String toString() {
        String text = this.text;
        if (text == null) {
            this.text = text = name + '(' + (byteValue & 0xFF) + ')';
        }
        return text;
    }
}

Frequently Asked Questions

What is the Socks5AddressType class?
Socks5AddressType is a class in the netty codebase, defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/Socks5AddressType.java.
Where is Socks5AddressType defined?
Socks5AddressType is defined in codec-socks/src/main/java/io/netty/handler/codec/socksx/v5/Socks5AddressType.java at line 24.

Analyze Your Own Codebase

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

Try Supermodel Free