Record Class Stage
java.lang.Object
java.lang.Record
com.tnsai.coordination.groups.pipeline.Stage
- Record Components:
name- stage nameagentId- agent responsible for this stageindex- position in the pipeline (0-based)transformFunction- optional function to transform input before passing to agent
public record Stage(String name, String agentId, int index, UnaryOperator<String> transformFunction)
extends Record
Represents a single stage in a processing pipeline.
-
Constructor Summary
ConstructorsConstructorDescriptionStage(String name, String agentId, int index, UnaryOperator<String> transformFunction) Creates a Stage with validation. -
Method Summary
Modifier and TypeMethodDescriptionagentId()Returns the value of theagentIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intindex()Returns the value of theindexrecord component.name()Returns the value of thenamerecord component.static StageCreates a simple stage without transform.final StringtoString()Returns a string representation of this record class.Returns the value of thetransformFunctionrecord component.
-
Constructor Details
-
Stage
Creates a Stage with validation.
-
-
Method Details
-
of
Creates a simple stage without transform.- Parameters:
name- stage nameagentId- agent IDindex- stage index- Returns:
- stage
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
agentId
Returns the value of theagentIdrecord component.- Returns:
- the value of the
agentIdrecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
transformFunction
Returns the value of thetransformFunctionrecord component.- Returns:
- the value of the
transformFunctionrecord component
-