Home / Class/ Http2StreamChannelId Class — netty Architecture

Http2StreamChannelId Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  bf8e3bbe_400f_5065_b4bd_a10f33280068["Http2StreamChannelId"]
  92acb026_f80a_0cbc_9556_5e9ac58111ed["Http2StreamChannelId.java"]
  bf8e3bbe_400f_5065_b4bd_a10f33280068 -->|defined in| 92acb026_f80a_0cbc_9556_5e9ac58111ed
  e5be5089_65f6_a87e_c6ce_61683419a667["Http2StreamChannelId()"]
  bf8e3bbe_400f_5065_b4bd_a10f33280068 -->|method| e5be5089_65f6_a87e_c6ce_61683419a667
  14ea342f_434c_192e_dd0d_beb079b7b616["String()"]
  bf8e3bbe_400f_5065_b4bd_a10f33280068 -->|method| 14ea342f_434c_192e_dd0d_beb079b7b616
  9b76b453_37c9_c223_d86f_e8d143baebcd["compareTo()"]
  bf8e3bbe_400f_5065_b4bd_a10f33280068 -->|method| 9b76b453_37c9_c223_d86f_e8d143baebcd
  320478e8_e4ae_207b_c970_ec73a33c9144["hashCode()"]
  bf8e3bbe_400f_5065_b4bd_a10f33280068 -->|method| 320478e8_e4ae_207b_c970_ec73a33c9144
  8a80393b_4b8e_849f_60c2_f561b5a8b1ed["equals()"]
  bf8e3bbe_400f_5065_b4bd_a10f33280068 -->|method| 8a80393b_4b8e_849f_60c2_f561b5a8b1ed
  78d1b303_9cb1_d916_9ff0_d59d55fcd137["getSequenceId()"]
  bf8e3bbe_400f_5065_b4bd_a10f33280068 -->|method| 78d1b303_9cb1_d916_9ff0_d59d55fcd137

Relationship Graph

Source Code

codec-http2/src/main/java/io/netty/handler/codec/http2/Http2StreamChannelId.java lines 23–80

final class Http2StreamChannelId implements ChannelId {
    private static final long serialVersionUID = -6642338822166867585L;

    private final int id;
    private final ChannelId parentId;

    Http2StreamChannelId(ChannelId parentId, int id) {
        this.parentId = parentId;
        this.id = id;
    }

    @Override
    public String asShortText() {
        return parentId.asShortText() + '/' + id;
    }

    @Override
    public String asLongText() {
        return parentId.asLongText() + '/' + id;
    }

    @Override
    public int compareTo(ChannelId o) {
        if (o instanceof Http2StreamChannelId) {
            Http2StreamChannelId otherId = (Http2StreamChannelId) o;
            int res = parentId.compareTo(otherId.parentId);
            if (res == 0) {
                return id - otherId.id;
            } else {
                return res;
            }
        }
        return parentId.compareTo(o);
    }

    @Override
    public int hashCode() {
        return id * 31 + parentId.hashCode();
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof Http2StreamChannelId)) {
            return false;
        }
        Http2StreamChannelId otherId = (Http2StreamChannelId) obj;
        return id == otherId.id && parentId.equals(otherId.parentId);
    }

    public int getSequenceId() {
        return id;
    }

    @Override
    public String toString() {
        return asShortText();
    }
}

Frequently Asked Questions

What is the Http2StreamChannelId class?
Http2StreamChannelId is a class in the netty codebase, defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2StreamChannelId.java.
Where is Http2StreamChannelId defined?
Http2StreamChannelId is defined in codec-http2/src/main/java/io/netty/handler/codec/http2/Http2StreamChannelId.java at line 23.

Analyze Your Own Codebase

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

Try Supermodel Free