Class BytesSchemaVersion
- java.lang.Object
-
- org.apache.pulsar.common.protocol.schema.BytesSchemaVersion
-
- All Implemented Interfaces:
java.lang.Comparable<BytesSchemaVersion>,SchemaVersion
public class BytesSchemaVersion extends java.lang.Object implements SchemaVersion, java.lang.Comparable<BytesSchemaVersion>
Bytes schema version.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBytesSchemaVersion.ByteArrayComparatorThis interface helps to compare byte arrays.
-
Field Summary
Fields Modifier and Type Field Description static BytesSchemaVersion.ByteArrayComparatorBYTES_LEXICO_COMPARATORA byte array comparator based on lexicograpic ordering.-
Fields inherited from interface org.apache.pulsar.common.protocol.schema.SchemaVersion
Empty, Latest
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]bytes()intcompareTo(BytesSchemaVersion that)booleanequals(java.lang.Object other)byte[]get()Get the data from the Bytes.inthashCode()The hashcode is cached except for the case where it is computed as 0, in which case we compute the hashcode on every call.static BytesSchemaVersionof(byte[] bytes)java.lang.StringtoString()
-
-
-
Field Detail
-
BYTES_LEXICO_COMPARATOR
public static final BytesSchemaVersion.ByteArrayComparator BYTES_LEXICO_COMPARATOR
A byte array comparator based on lexicograpic ordering.
-
-
Method Detail
-
bytes
public byte[] bytes()
- Specified by:
bytesin interfaceSchemaVersion
-
of
public static BytesSchemaVersion of(byte[] bytes)
-
get
public byte[] get()
Get the data from the Bytes.- Returns:
- The underlying byte array
-
hashCode
public int hashCode()
The hashcode is cached except for the case where it is computed as 0, in which case we compute the hashcode on every call.- Overrides:
hashCodein classjava.lang.Object- Returns:
- the hashcode
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(BytesSchemaVersion that)
- Specified by:
compareToin interfacejava.lang.Comparable<BytesSchemaVersion>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-