Class ImmutableDecisionResult.Builder
java.lang.Object
io.resys.hdes.client.api.programs.ImmutableDecisionResult.Builder
- Enclosing class:
- ImmutableDecisionResult
Builds instances of type
ImmutableDecisionResult.
Initialize attributes and then invoke the build() method to create an
immutable instance.
Builder is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllMatches(Iterable<? extends DecisionProgram.DecisionLog> elements) Adds elements tomatcheslist.addAllRejections(Iterable<? extends DecisionProgram.DecisionLog> elements) Adds elements torejectionslist.addMatches(DecisionProgram.DecisionLog element) Adds one element tomatcheslist.addMatches(DecisionProgram.DecisionLog... elements) Adds elements tomatcheslist.addRejections(DecisionProgram.DecisionLog element) Adds one element torejectionslist.addRejections(DecisionProgram.DecisionLog... elements) Adds elements torejectionslist.build()Builds a newImmutableDecisionResult.from(DecisionProgram.DecisionResult instance) Fill a builder with attribute values from the providedDecisionResultinstance.matches(Iterable<? extends DecisionProgram.DecisionLog> elements) Sets or replaces all elements formatcheslist.rejections(Iterable<? extends DecisionProgram.DecisionLog> elements) Sets or replaces all elements forrejectionslist.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder from(DecisionProgram.DecisionResult instance) Fill a builder with attribute values from the providedDecisionResultinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addRejections
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder addRejections(DecisionProgram.DecisionLog element) Adds one element torejectionslist.- Parameters:
element- A rejections element- Returns:
thisbuilder for use in a chained invocation
-
addRejections
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder addRejections(DecisionProgram.DecisionLog... elements) Adds elements torejectionslist.- Parameters:
elements- An array of rejections elements- Returns:
thisbuilder for use in a chained invocation
-
rejections
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder rejections(Iterable<? extends DecisionProgram.DecisionLog> elements) Sets or replaces all elements forrejectionslist.- Parameters:
elements- An iterable of rejections elements- Returns:
thisbuilder for use in a chained invocation
-
addAllRejections
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder addAllRejections(Iterable<? extends DecisionProgram.DecisionLog> elements) Adds elements torejectionslist.- Parameters:
elements- An iterable of rejections elements- Returns:
thisbuilder for use in a chained invocation
-
addMatches
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder addMatches(DecisionProgram.DecisionLog element) Adds one element tomatcheslist.- Parameters:
element- A matches element- Returns:
thisbuilder for use in a chained invocation
-
addMatches
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder addMatches(DecisionProgram.DecisionLog... elements) Adds elements tomatcheslist.- Parameters:
elements- An array of matches elements- Returns:
thisbuilder for use in a chained invocation
-
matches
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder matches(Iterable<? extends DecisionProgram.DecisionLog> elements) Sets or replaces all elements formatcheslist.- Parameters:
elements- An iterable of matches elements- Returns:
thisbuilder for use in a chained invocation
-
addAllMatches
@CanIgnoreReturnValue public final ImmutableDecisionResult.Builder addAllMatches(Iterable<? extends DecisionProgram.DecisionLog> elements) Adds elements tomatcheslist.- Parameters:
elements- An iterable of matches elements- Returns:
thisbuilder for use in a chained invocation
-
build
Builds a newImmutableDecisionResult.- Returns:
- An immutable instance of DecisionResult
- Throws:
IllegalStateException- if any required attributes are missing
-