Interface OperationCode
public interface OperationCode
Interface for types that carry a unique operation code identifier.
Each implementation holds an integer code that is auto-assigned via a global atomic counter.
- Since:
- 21.23
- Author:
- 渔民小镇
- date:
- 2025-01-08
-
Method Summary
Modifier and TypeMethodDescriptionstatic intAtomically get the current global code value and increment it for the next caller.intReturn the operation code assigned to this instance.
-
Method Details
-
getOperationCode
int getOperationCode()Return the operation code assigned to this instance.- Returns:
- the unique operation code
-
getAndIncrementCode
static int getAndIncrementCode()Atomically get the current global code value and increment it for the next caller.- Returns:
- the next available operation code
-