Home / Class/ IdleStateEvent Class — netty Architecture

IdleStateEvent Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  6024c16a_5f09_f8af_b540_2d1184b0faa6["IdleStateEvent"]
  8a918cff_7a4d_0fd4_9005_d120e85e0eea["IdleStateEvent.java"]
  6024c16a_5f09_f8af_b540_2d1184b0faa6 -->|defined in| 8a918cff_7a4d_0fd4_9005_d120e85e0eea
  8b2afa66_2c96_7ea4_7592_07674b56193e["IdleStateEvent()"]
  6024c16a_5f09_f8af_b540_2d1184b0faa6 -->|method| 8b2afa66_2c96_7ea4_7592_07674b56193e
  983ba107_abbd_4afd_6a02_816afadbf6fd["IdleState()"]
  6024c16a_5f09_f8af_b540_2d1184b0faa6 -->|method| 983ba107_abbd_4afd_6a02_816afadbf6fd
  529582d8_0c9f_c5df_92e1_6691dcc349fa["isFirst()"]
  6024c16a_5f09_f8af_b540_2d1184b0faa6 -->|method| 529582d8_0c9f_c5df_92e1_6691dcc349fa
  a5a20b65_20bb_e532_e0fb_9b00ef9932b4["String()"]
  6024c16a_5f09_f8af_b540_2d1184b0faa6 -->|method| a5a20b65_20bb_e532_e0fb_9b00ef9932b4

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/timeout/IdleStateEvent.java lines 25–85

public class IdleStateEvent {
    public static final IdleStateEvent FIRST_READER_IDLE_STATE_EVENT =
            new DefaultIdleStateEvent(IdleState.READER_IDLE, true);
    public static final IdleStateEvent READER_IDLE_STATE_EVENT =
            new DefaultIdleStateEvent(IdleState.READER_IDLE, false);
    public static final IdleStateEvent FIRST_WRITER_IDLE_STATE_EVENT =
            new DefaultIdleStateEvent(IdleState.WRITER_IDLE, true);
    public static final IdleStateEvent WRITER_IDLE_STATE_EVENT =
            new DefaultIdleStateEvent(IdleState.WRITER_IDLE, false);
    public static final IdleStateEvent FIRST_ALL_IDLE_STATE_EVENT =
            new DefaultIdleStateEvent(IdleState.ALL_IDLE, true);
    public static final IdleStateEvent ALL_IDLE_STATE_EVENT =
            new DefaultIdleStateEvent(IdleState.ALL_IDLE, false);

    private final IdleState state;
    private final boolean first;

    /**
     * Constructor for sub-classes.
     *
     * @param state the {@link IdleStateEvent} which triggered the event.
     * @param first {@code true} if its the first idle event for the {@link IdleStateEvent}.
     */
    protected IdleStateEvent(IdleState state, boolean first) {
        this.state = ObjectUtil.checkNotNull(state, "state");
        this.first = first;
    }

    /**
     * Returns the idle state.
     */
    public IdleState state() {
        return state;
    }

    /**
     * Returns {@code true} if this was the first event for the {@link IdleState}
     */
    public boolean isFirst() {
        return first;
    }

    @Override
    public String toString() {
        return StringUtil.simpleClassName(this) + '(' + state + (first ? ", first" : "") + ')';
    }

    private static final class DefaultIdleStateEvent extends IdleStateEvent {
        private final String representation;

        DefaultIdleStateEvent(IdleState state, boolean first) {
            super(state, first);
            this.representation = "IdleStateEvent(" + state + (first ? ", first" : "") + ')';
        }

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

Frequently Asked Questions

What is the IdleStateEvent class?
IdleStateEvent is a class in the netty codebase, defined in handler/src/main/java/io/netty/handler/timeout/IdleStateEvent.java.
Where is IdleStateEvent defined?
IdleStateEvent is defined in handler/src/main/java/io/netty/handler/timeout/IdleStateEvent.java at line 25.

Analyze Your Own Codebase

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

Try Supermodel Free