Class ImmutableMatchedRuleValue
java.lang.Object
io.camunda.zeebe.protocol.record.value.ImmutableMatchedRuleValue
- All Implemented Interfaces:
JsonSerializable,RecordValue,MatchedRuleValue
Immutable implementation of
MatchedRuleValue.
Use the builder to create immutable instances:
ImmutableMatchedRuleValue.builder().
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds instances of typeImmutableMatchedRuleValue. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder forImmutableMatchedRuleValue.static ImmutableMatchedRuleValuecopyOf(MatchedRuleValue instance) Creates an immutable copy of aMatchedRuleValuevalue.booleanThis instance is equal to all instances ofImmutableMatchedRuleValuethat have equal attribute values.intReturns the index of the matched rule in the decision table, starting with 1.inthashCode()Returns a lazily computed hash code from attributes:ruleId,ruleIndex,evaluatedOutputs.toString()Prints the immutable valueMatchedRuleValuewith attribute values.withEvaluatedOutputs(EvaluatedOutputValue... elements) Copy the current immutable object with elements that replace the content ofevaluatedOutputs.withEvaluatedOutputs(Iterable<? extends EvaluatedOutputValue> elements) Copy the current immutable object with elements that replace the content ofevaluatedOutputs.withRuleId(String value) Copy the current immutable object by setting a value for theruleIdattribute.withRuleIndex(int value) Copy the current immutable object by setting a value for theruleIndexattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.camunda.zeebe.protocol.record.JsonSerializable
toJson
-
Method Details
-
getRuleId
- Specified by:
getRuleIdin interfaceMatchedRuleValue- Returns:
- the id of the matched rule
-
getRuleIndex
public int getRuleIndex()Returns the index of the matched rule in the decision table, starting with 1.- Specified by:
getRuleIndexin interfaceMatchedRuleValue- Returns:
- the index of the matched rule
-
getEvaluatedOutputs
- Specified by:
getEvaluatedOutputsin interfaceMatchedRuleValue- Returns:
- the evaluated outputs of the rule
-
withRuleId
Copy the current immutable object by setting a value for theruleIdattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ruleId (can benull)- Returns:
- A modified copy of the
thisobject
-
withRuleIndex
Copy the current immutable object by setting a value for theruleIndexattribute. A value equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for ruleIndex- Returns:
- A modified copy of the
thisobject
-
withEvaluatedOutputs
Copy the current immutable object with elements that replace the content ofevaluatedOutputs.- Parameters:
elements- The elements to set- Returns:
- A modified copy of
thisobject
-
withEvaluatedOutputs
public final ImmutableMatchedRuleValue withEvaluatedOutputs(Iterable<? extends EvaluatedOutputValue> elements) Copy the current immutable object with elements that replace the content ofevaluatedOutputs. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
elements- An iterable of evaluatedOutputs elements to set- Returns:
- A modified copy of
thisobject
-
equals
This instance is equal to all instances ofImmutableMatchedRuleValuethat have equal attribute values. -
hashCode
public int hashCode()Returns a lazily computed hash code from attributes:ruleId,ruleIndex,evaluatedOutputs. -
toString
Prints the immutable valueMatchedRuleValuewith attribute values. -
copyOf
Creates an immutable copy of aMatchedRuleValuevalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable MatchedRuleValue instance
-
builder
Creates a builder forImmutableMatchedRuleValue.ImmutableMatchedRuleValue.builder() .withRuleId(String | null) // nullableruleId.withRuleIndex(int) // optionalruleIndex.addEvaluatedOutput|addAllEvaluatedOutputs(io.camunda.zeebe.protocol.record.value.EvaluatedOutputValue) //evaluatedOutputselements .build();- Returns:
- A new ImmutableMatchedRuleValue builder
-