Mark IdleStateEvent as final and add javadocs
This commit is contained in:
parent
43d13064d1
commit
a1baeeb8c0
@ -23,12 +23,19 @@ import io.netty.channel.Channel;
|
|||||||
* @apiviz.landmark
|
* @apiviz.landmark
|
||||||
* @apiviz.has io.netty.handler.timeout.IdleState oneway - -
|
* @apiviz.has io.netty.handler.timeout.IdleState oneway - -
|
||||||
*/
|
*/
|
||||||
public class IdleStateEvent {
|
public final class IdleStateEvent {
|
||||||
|
|
||||||
private final IdleState state;
|
private final IdleState state;
|
||||||
private final int count;
|
private final int count;
|
||||||
private final long durationMillis;
|
private final long durationMillis;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new instance
|
||||||
|
*
|
||||||
|
* @param state the detailed idle state.
|
||||||
|
* @param count the count how often this kind of {@IdleStateEvent} was fired before
|
||||||
|
* @param durationMillis the duration which caused the {@link IdleStateEvent} to get fired in milliseconds
|
||||||
|
*/
|
||||||
public IdleStateEvent(IdleState state, int count, long durationMillis) {
|
public IdleStateEvent(IdleState state, int count, long durationMillis) {
|
||||||
if (state == null) {
|
if (state == null) {
|
||||||
throw new NullPointerException("state");
|
throw new NullPointerException("state");
|
||||||
@ -53,10 +60,16 @@ public class IdleStateEvent {
|
|||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the count how often this kind of {@IdleStateEvent} was fired before.
|
||||||
|
*/
|
||||||
public int count() {
|
public int count() {
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the duration which caused the {@link IdleStateEvent} to get fired in milliseconds.
|
||||||
|
*/
|
||||||
public long durationMillis() {
|
public long durationMillis() {
|
||||||
return durationMillis;
|
return durationMillis;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user