Class BytesSchemaVersion
java.lang.Object
org.apache.pulsar.common.protocol.schema.BytesSchemaVersion
- All Implemented Interfaces:
Comparable<BytesSchemaVersion>,SchemaVersion
public class BytesSchemaVersion
extends Object
implements SchemaVersion, Comparable<BytesSchemaVersion>
Bytes schema version.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis interface helps to compare byte arrays. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final BytesSchemaVersion.ByteArrayComparatorA byte array comparator based on lexicograpic ordering.Fields inherited from interface org.apache.pulsar.common.protocol.schema.SchemaVersion
Empty, Latest -
Method Summary
Modifier and TypeMethodDescriptionbyte[]bytes()intcompareTo(BytesSchemaVersion that) booleanbyte[]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) toString()
-
Field Details
-
BYTES_LEXICO_COMPARATOR
A byte array comparator based on lexicograpic ordering.
-
-
Method Details
-
bytes
public byte[] bytes()- Specified by:
bytesin interfaceSchemaVersion
-
of
-
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. -
equals
-
compareTo
- Specified by:
compareToin interfaceComparable<BytesSchemaVersion>
-
toString
-