Class ImmutableDecisionProgram

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

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

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

See Also:
  • Method Details

    • getRows

      public com.google.common.collect.ImmutableList<DecisionProgram.DecisionRow> getRows()
      Specified by:
      getRows in interface DecisionProgram
      Returns:
      The value of the rows attribute
    • getHitPolicy

      public AstDecision.HitPolicy getHitPolicy()
      Specified by:
      getHitPolicy in interface DecisionProgram
      Returns:
      The value of the hitPolicy attribute
    • withRows

      public final ImmutableDecisionProgram withRows(DecisionProgram.DecisionRow... elements)
      Copy the current immutable object with elements that replace the content of rows.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withRows

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

      public final ImmutableDecisionProgram withHitPolicy(AstDecision.HitPolicy value)
      Copy the current immutable object by setting a value for the hitPolicy attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hitPolicy
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableDecisionProgram 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: rows, hitPolicy.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableDecisionProgram copyOf(DecisionProgram instance)
      Creates an immutable copy of a DecisionProgram 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 DecisionProgram instance
    • builder

      public static ImmutableDecisionProgram.Builder builder()
      Creates a builder for ImmutableDecisionProgram.
       ImmutableDecisionProgram.builder()
          .addRows|addAllRows(io.resys.hdes.client.api.programs.DecisionProgram.DecisionRow) // rows elements
          .hitPolicy(io.resys.hdes.client.api.ast.AstDecision.HitPolicy) // required hitPolicy
          .build();
       
      Returns:
      A new ImmutableDecisionProgram builder