Home / Type/ StompVersion Type — netty Architecture

StompVersion Type — netty Architecture

Architecture documentation for the StompVersion type/interface in StompVersion.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0837c1e7_dbf5_f58a_3a9c_1dfea23242e9["StompVersion"]
  6a90ba8e_025c_2a07_2d1c_92b82b762144["StompVersion.java"]
  0837c1e7_dbf5_f58a_3a9c_1dfea23242e9 -->|defined in| 6a90ba8e_025c_2a07_2d1c_92b82b762144
  style 0837c1e7_dbf5_f58a_3a9c_1dfea23242e9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/stomp/websocket/StompVersion.java lines 24–69

public enum StompVersion {

    STOMP_V11("1.1", "v11.stomp"),

    STOMP_V12("1.2", "v12.stomp");

    public static final AttributeKey<StompVersion> CHANNEL_ATTRIBUTE_KEY = AttributeKey.valueOf("stomp_version");
    public static final String SUB_PROTOCOLS;

    static {
        List<String> subProtocols = new ArrayList<String>(values().length);
        for (StompVersion stompVersion : values()) {
            subProtocols.add(stompVersion.subProtocol);
        }

        SUB_PROTOCOLS = StringUtil.join(",", subProtocols).toString();
    }

    private final String version;
    private final String subProtocol;

    StompVersion(String version, String subProtocol) {
        this.version = version;
        this.subProtocol = subProtocol;
    }

    public String version() {
        return version;
    }

    public String subProtocol() {
        return subProtocol;
    }

    public static StompVersion findBySubProtocol(String subProtocol) {
        if (subProtocol != null) {
            for (StompVersion stompVersion : values()) {
                if (stompVersion.subProtocol().equals(subProtocol)) {
                    return stompVersion;
                }
            }
        }

        throw new IllegalArgumentException("Not found StompVersion for '" + subProtocol + "'");
    }
}

Frequently Asked Questions

What is the StompVersion type?
StompVersion is a type/interface in the netty codebase, defined in example/src/main/java/io/netty/example/stomp/websocket/StompVersion.java.
Where is StompVersion defined?
StompVersion is defined in example/src/main/java/io/netty/example/stomp/websocket/StompVersion.java at line 24.

Analyze Your Own Codebase

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

Try Supermodel Free