Package io.netty.channel
Class DefaultChannelId
- java.lang.Object
-
- io.netty.channel.DefaultChannelId
-
public final class DefaultChannelId extends java.lang.Object implements ChannelId
The defaultChannelId
implementation.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private byte[]
data
private int
hashCode
private static InternalLogger
logger
private java.lang.String
longValue
private static byte[]
MACHINE_ID
private static java.util.concurrent.atomic.AtomicInteger
nextSequence
private static int
PROCESS_ID
private static int
PROCESS_ID_LEN
private static int
RANDOM_LEN
private static int
SEQUENCE_LEN
private static long
serialVersionUID
private java.lang.String
shortValue
private static int
TIMESTAMP_LEN
-
Constructor Summary
Constructors Modifier Constructor Description private
DefaultChannelId()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private int
appendHexDumpField(java.lang.StringBuilder buf, int i, int length)
java.lang.String
asLongText()
Returns the long yet globally unique string representation of theChannelId
.java.lang.String
asShortText()
Returns the short but globally non-unique string representation of theChannelId
.int
compareTo(ChannelId o)
private static int
defaultProcessId()
boolean
equals(java.lang.Object obj)
int
hashCode()
static DefaultChannelId
newInstance()
Returns a newDefaultChannelId
instance.private java.lang.String
newLongValue()
java.lang.String
toString()
private int
writeInt(int i, int value)
private int
writeLong(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 newDefaultChannelId
instance.
-
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:ChannelId
Returns the short but globally non-unique string representation of theChannelId
.- Specified by:
asShortText
in interfaceChannelId
-
asLongText
public java.lang.String asLongText()
Description copied from interface:ChannelId
Returns the long yet globally unique string representation of theChannelId
.- Specified by:
asLongText
in interfaceChannelId
-
newLongValue
private java.lang.String newLongValue()
-
appendHexDumpField
private int appendHexDumpField(java.lang.StringBuilder buf, int i, int length)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(ChannelId o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ChannelId>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-