Package com.yworkflow.common.caller
Class ImmutableWorkflowCaller
java.lang.Object
com.yworkflow.common.caller.ImmutableWorkflowCaller
- All Implemented Interfaces:
WorkflowCaller,Comparable<WorkflowCaller>
Immutable implementation of WorkflowCaller that stores a caller identity string. This class
provides a thread-safe, immutable representation of a workflow caller that can be used for access
control and audit purposes.
ImmutableWorkflowCaller instances are created with a caller identity string, which can be null for anonymous callers. The class implements proper comparison semantics and provides access to the caller value through the WorkflowCaller interface.
This implementation is used internally by the WorkflowCaller factory methods and provides the default behavior for caller identity management.
- Since:
- 1.0
- See Also:
-
Field Summary
Fields inherited from interface com.yworkflow.common.caller.WorkflowCaller
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionImmutableWorkflowCaller(String caller) Creates a new ImmutableWorkflowCaller with the specified caller identity. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this WorkflowCaller with another WorkflowCaller for ordering.value()Returns the optional caller identity string.
-
Constructor Details
-
ImmutableWorkflowCaller
Creates a new ImmutableWorkflowCaller with the specified caller identity.- Parameters:
caller- the caller identity string (can be null for anonymous callers)
-
-
Method Details
-
value
Returns the optional caller identity string.- Specified by:
valuein interfaceWorkflowCaller- Returns:
- an Optional containing the caller identity if present, empty for anonymous callers
-
compareTo
Compares this WorkflowCaller with another WorkflowCaller for ordering. Comparison is based on the caller identity string, with null values being treated as empty strings.- Specified by:
compareToin interfaceComparable<WorkflowCaller>- Parameters:
o- the WorkflowCaller to compare with- Returns:
- a negative integer, zero, or a positive integer as this WorkflowCaller is less than, equal to, or greater than the specified WorkflowCaller
-