public static class WorkerIdentity.ParserV1 extends Object
WorkerIdentity
that is based on a UUID.
Modifier and Type | Field and Description |
---|---|
static WorkerIdentity.ParserV1 |
INSTANCE |
static int |
VERSION |
Modifier and Type | Method and Description |
---|---|
protected void |
ensureVersionMatch(WorkerIdentity identity) |
WorkerIdentity |
fromProto(WorkerIdentity workerIdentityProto)
Parses from a Protobuf representation.
|
WorkerIdentity |
fromUUID(String uuid)
Parses a worker identity from a string representation of a UUID.
|
WorkerIdentity |
fromUUID(UUID uuid)
Parses from a UUID representation.
|
int |
getVersion() |
Object |
getVersionSpecificRepresentation(WorkerIdentity identity) |
protected UUID |
getVersionSpecificRepresentation0(WorkerIdentity identity) |
protected byte[] |
parseIdentifier(com.google.protobuf.ByteString identifier) |
WorkerIdentity |
toProto(WorkerIdentity workerIdentity)
Converts to a protobuf representation.
|
UUID |
toUUID(WorkerIdentity identity)
Converts to a UUID.
|
public static final WorkerIdentity.ParserV1 INSTANCE
public static final int VERSION
public int getVersion()
protected byte[] parseIdentifier(com.google.protobuf.ByteString identifier) throws ProtoParsingException
ProtoParsingException
protected UUID getVersionSpecificRepresentation0(WorkerIdentity identity)
public WorkerIdentity fromUUID(UUID uuid)
uuid
- the uuid representing the worker identitypublic WorkerIdentity fromUUID(String uuid) throws IllegalArgumentException
uuid
- the string representation of the UUID that is used as the worker's identityIllegalArgumentException
- if the string is not a valid representation of a UUIDfromUUID(UUID)
public UUID toUUID(WorkerIdentity identity) throws IllegalArgumentException
identity
- the worker identityIllegalArgumentException
- if the identity was not created from a UUIDpublic 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.