Class ImmutableDecisionResult

java.lang.Object
io.resys.hdes.client.api.programs.ImmutableDecisionResult
All Implemented Interfaces:
DecisionProgram.DecisionResult, Program.ProgramResult, Serializable

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableDecisionResult extends Object implements DecisionProgram.DecisionResult
Immutable implementation of DecisionProgram.DecisionResult.

Use the builder to create immutable instances: ImmutableDecisionResult.builder().

See Also:
  • Method Details

    • getRejections

      public com.google.common.collect.ImmutableList<DecisionProgram.DecisionLog> getRejections()
      Specified by:
      getRejections in interface DecisionProgram.DecisionResult
      Returns:
      The value of the rejections attribute
    • getMatches

      public com.google.common.collect.ImmutableList<DecisionProgram.DecisionLog> getMatches()
      Specified by:
      getMatches in interface DecisionProgram.DecisionResult
      Returns:
      The value of the matches attribute
    • withRejections

      public final ImmutableDecisionResult withRejections(DecisionProgram.DecisionLog... elements)
      Copy the current immutable object with elements that replace the content of rejections.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withRejections

      public final ImmutableDecisionResult withRejections(Iterable<? extends DecisionProgram.DecisionLog> elements)
      Copy the current immutable object with elements that replace the content of rejections. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of rejections elements to set
      Returns:
      A modified copy of this object
    • withMatches

      public final ImmutableDecisionResult withMatches(DecisionProgram.DecisionLog... elements)
      Copy the current immutable object with elements that replace the content of matches.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withMatches

      public final ImmutableDecisionResult withMatches(Iterable<? extends DecisionProgram.DecisionLog> elements)
      Copy the current immutable object with elements that replace the content of matches. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of matches elements to set
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDecisionResult that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: rejections, matches.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value DecisionResult with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      Creates an immutable copy of a DecisionProgram.DecisionResult value. 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 DecisionResult instance
    • builder

      public static ImmutableDecisionResult.Builder builder()
      Creates a builder for ImmutableDecisionResult.
       ImmutableDecisionResult.builder()
          .addRejections|addAllRejections(io.resys.hdes.client.api.programs.DecisionProgram.DecisionLog) // rejections elements
          .addMatches|addAllMatches(io.resys.hdes.client.api.programs.DecisionProgram.DecisionLog) // matches elements
          .build();
       
      Returns:
      A new ImmutableDecisionResult builder