public static class WorkerIdentity.ParserV0 extends Object
Modifier and Type | Field and Description |
---|---|
static WorkerIdentity.ParserV0 |
INSTANCE |
static int |
VERSION |
Modifier and Type | Method and Description |
---|---|
protected void |
ensureVersionMatch(WorkerIdentity identity) |
WorkerIdentity |
fromLong(long workerId)
Parses from a long worker ID.
|
WorkerIdentity |
fromProto(WorkerIdentity workerIdentityProto)
Parses from a Protobuf representation.
|
int |
getVersion() |
Object |
getVersionSpecificRepresentation(WorkerIdentity identity) |
protected Long |
getVersionSpecificRepresentation0(WorkerIdentity workerIdentity) |
protected byte[] |
parseIdentifier(com.google.protobuf.ByteString identifier) |
long |
toLong(WorkerIdentity identity)
Converts to a numeric worker ID represented as a
long . |
WorkerIdentity |
toProto(WorkerIdentity workerIdentity)
Converts to a protobuf representation.
|
public static final WorkerIdentity.ParserV0 INSTANCE
public static final int VERSION
public int getVersion()
protected byte[] parseIdentifier(com.google.protobuf.ByteString identifier) throws ProtoParsingException
ProtoParsingException
protected Long getVersionSpecificRepresentation0(WorkerIdentity workerIdentity)
public WorkerIdentity fromLong(long workerId)
workerId
- worker IDpublic long toLong(WorkerIdentity identity) throws IllegalArgumentException
long
.identity
- identityIllegalArgumentException
- if the identity was not created from a numeric IDpublic Object getVersionSpecificRepresentation(WorkerIdentity identity)
protected void ensureVersionMatch(WorkerIdentity identity) throws IllegalArgumentException
IllegalArgumentException
public WorkerIdentity toProto(WorkerIdentity workerIdentity)
workerIdentity
- the object to convertpublic WorkerIdentity fromProto(WorkerIdentity workerIdentityProto) throws ProtoParsingException
workerIdentityProto
- the proto messageMissingRequiredFieldsParsingException
- if the version or the identifier fields are
missing in the protobuf representationInvalidVersionParsingException
- if the version is not getVersion()
ProtoParsingException
- if the protobuf representation is invalidCopyright © 2023. All Rights Reserved.