Package io.netty.channel
Class DefaultChannelId
- java.lang.Object
-
- io.netty.channel.DefaultChannelId
-
public final class DefaultChannelId extends java.lang.Object implements ChannelId
The defaultChannelIdimplementation.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]dataprivate inthashCodeprivate static InternalLoggerloggerprivate java.lang.StringlongValueprivate static byte[]MACHINE_IDprivate static java.util.concurrent.atomic.AtomicIntegernextSequenceprivate static intPROCESS_IDprivate static intPROCESS_ID_LENprivate static intRANDOM_LENprivate static intSEQUENCE_LENprivate static longserialVersionUIDprivate java.lang.StringshortValueprivate static intTIMESTAMP_LEN
-
Constructor Summary
Constructors Modifier Constructor Description privateDefaultChannelId()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private intappendHexDumpField(java.lang.StringBuilder buf, int i, int length)java.lang.StringasLongText()Returns the long yet globally unique string representation of theChannelId.java.lang.StringasShortText()Returns the short but globally non-unique string representation of theChannelId.intcompareTo(ChannelId o)private static intdefaultProcessId()booleanequals(java.lang.Object obj)inthashCode()static DefaultChannelIdnewInstance()Returns a newDefaultChannelIdinstance.private java.lang.StringnewLongValue()java.lang.StringtoString()private intwriteInt(int i, int value)private intwriteLong(int i, long value)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
logger
private static final InternalLogger logger
-
MACHINE_ID
private static final byte[] MACHINE_ID
-
PROCESS_ID_LEN
private static final int PROCESS_ID_LEN
- See Also:
- Constant Field Values
-
PROCESS_ID
private static final int PROCESS_ID
-
SEQUENCE_LEN
private static final int SEQUENCE_LEN
- See Also:
- Constant Field Values
-
TIMESTAMP_LEN
private static final int TIMESTAMP_LEN
- See Also:
- Constant Field Values
-
RANDOM_LEN
private static final int RANDOM_LEN
- See Also:
- Constant Field Values
-
nextSequence
private static final java.util.concurrent.atomic.AtomicInteger nextSequence
-
data
private final byte[] data
-
hashCode
private final int hashCode
-
shortValue
private transient java.lang.String shortValue
-
longValue
private transient java.lang.String longValue
-
-
Method Detail
-
newInstance
public static DefaultChannelId newInstance()
Returns a newDefaultChannelIdinstance.
-
defaultProcessId
private static int defaultProcessId()
-
writeInt
private int writeInt(int i, int value)
-
writeLong
private int writeLong(int i, long value)
-
asShortText
public java.lang.String asShortText()
Description copied from interface:ChannelIdReturns the short but globally non-unique string representation of theChannelId.- Specified by:
asShortTextin interfaceChannelId
-
asLongText
public java.lang.String asLongText()
Description copied from interface:ChannelIdReturns the long yet globally unique string representation of theChannelId.- Specified by:
asLongTextin interfaceChannelId
-
newLongValue
private java.lang.String newLongValue()
-
appendHexDumpField
private int appendHexDumpField(java.lang.StringBuilder buf, int i, int length)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(ChannelId o)
- Specified by:
compareToin interfacejava.lang.Comparable<ChannelId>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-