Class ImmutableProgramWrapper<A extends AstBody,P extends Program>

java.lang.Object
io.resys.hdes.client.api.programs.ImmutableProgramWrapper<A,P>
All Implemented Interfaces:
ProgramEnvir.ProgramWrapper<A,P>

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableProgramWrapper<A extends AstBody,P extends Program> extends Object implements ProgramEnvir.ProgramWrapper<A,P>
Immutable implementation of ProgramEnvir.ProgramWrapper.

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

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the id attribute
    • getType

      public AstBody.AstBodyType getType()
      Specified by:
      getType in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the type attribute
    • getStatus

      public ProgramEnvir.ProgramStatus getStatus()
      Specified by:
      getStatus in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the status attribute
    • getWarnings

      public com.google.common.collect.ImmutableList<ProgramEnvir.ProgramMessage> getWarnings()
      Specified by:
      getWarnings in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the warnings attribute
    • getErrors

      public com.google.common.collect.ImmutableList<ProgramEnvir.ProgramMessage> getErrors()
      Specified by:
      getErrors in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the errors attribute
    • getHeaders

      public com.google.common.collect.ImmutableList<TypeDef> getHeaders()
      Specified by:
      getHeaders in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the headers attribute
    • getAssociations

      public com.google.common.collect.ImmutableList<ProgramEnvir.ProgramAssociation> getAssociations()
      Specified by:
      getAssociations in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the associations attribute
    • getSource

      public AstBody.AstSource getSource()
      Specified by:
      getSource in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the source attribute
    • getAst

      public Optional<A> getAst()
      Specified by:
      getAst in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the ast attribute
    • getProgram

      public Optional<P> getProgram()
      Specified by:
      getProgram in interface ProgramEnvir.ProgramWrapper<A extends AstBody,P extends Program>
      Returns:
      The value of the program attribute
    • withId

      public final ImmutableProgramWrapper<A,P> withId(String value)
      Copy the current immutable object by setting a value for the id attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for id
      Returns:
      A modified copy of the this object
    • withType

      public final ImmutableProgramWrapper<A,P> withType(AstBody.AstBodyType value)
      Copy the current immutable object by setting a value for the type attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type
      Returns:
      A modified copy of the this object
    • withStatus

      public final ImmutableProgramWrapper<A,P> withStatus(ProgramEnvir.ProgramStatus value)
      Copy the current immutable object by setting a value for the status attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for status
      Returns:
      A modified copy of the this object
    • withWarnings

      public final ImmutableProgramWrapper<A,P> withWarnings(ProgramEnvir.ProgramMessage... elements)
      Copy the current immutable object with elements that replace the content of warnings.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withWarnings

      public final ImmutableProgramWrapper<A,P> withWarnings(Iterable<? extends ProgramEnvir.ProgramMessage> elements)
      Copy the current immutable object with elements that replace the content of warnings. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of warnings elements to set
      Returns:
      A modified copy of this object
    • withErrors

      public final ImmutableProgramWrapper<A,P> withErrors(ProgramEnvir.ProgramMessage... elements)
      Copy the current immutable object with elements that replace the content of errors.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withErrors

      public final ImmutableProgramWrapper<A,P> withErrors(Iterable<? extends ProgramEnvir.ProgramMessage> elements)
      Copy the current immutable object with elements that replace the content of errors. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of errors elements to set
      Returns:
      A modified copy of this object
    • withHeaders

      public final ImmutableProgramWrapper<A,P> withHeaders(TypeDef... elements)
      Copy the current immutable object with elements that replace the content of headers.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withHeaders

      public final ImmutableProgramWrapper<A,P> withHeaders(Iterable<? extends TypeDef> elements)
      Copy the current immutable object with elements that replace the content of headers. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of headers elements to set
      Returns:
      A modified copy of this object
    • withAssociations

      public final ImmutableProgramWrapper<A,P> withAssociations(ProgramEnvir.ProgramAssociation... elements)
      Copy the current immutable object with elements that replace the content of associations.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withAssociations

      public final ImmutableProgramWrapper<A,P> withAssociations(Iterable<? extends ProgramEnvir.ProgramAssociation> elements)
      Copy the current immutable object with elements that replace the content of associations. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of associations elements to set
      Returns:
      A modified copy of this object
    • withSource

      public final ImmutableProgramWrapper<A,P> withSource(AstBody.AstSource value)
      Copy the current immutable object by setting a value for the source attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for source
      Returns:
      A modified copy of the this object
    • withAst

      public final ImmutableProgramWrapper<A,P> withAst(A value)
      Copy the current immutable object by setting a present value for the optional ast attribute.
      Parameters:
      value - The value for ast
      Returns:
      A modified copy of this object
    • withAst

      public final ImmutableProgramWrapper<A,P> withAst(Optional<? extends A> optional)
      Copy the current immutable object by setting an optional value for the ast attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for ast
      Returns:
      A modified copy of this object
    • withProgram

      public final ImmutableProgramWrapper<A,P> withProgram(P value)
      Copy the current immutable object by setting a present value for the optional program attribute.
      Parameters:
      value - The value for program
      Returns:
      A modified copy of this object
    • withProgram

      public final ImmutableProgramWrapper<A,P> withProgram(Optional<? extends P> optional)
      Copy the current immutable object by setting an optional value for the program attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for program
      Returns:
      A modified copy of this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableProgramWrapper 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: id, type, status, warnings, errors, headers, associations, source, ast, program.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static <A extends AstBody, P extends Program> ImmutableProgramWrapper<A,P> copyOf(ProgramEnvir.ProgramWrapper<A,P> instance)
      Creates an immutable copy of a ProgramEnvir.ProgramWrapper value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Type Parameters:
      A - generic parameter A
      P - generic parameter P
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable ProgramWrapper instance
    • builder

      public static <A extends AstBody, P extends Program> ImmutableProgramWrapper.Builder<A,P> builder()
      Creates a builder for ImmutableProgramWrapper.
       ImmutableProgramWrapper.&lt;A, P&gt;builder()
          .id(String) // required id
          .type(io.resys.hdes.client.api.ast.AstBody.AstBodyType) // required type
          .status(io.resys.hdes.client.api.programs.ProgramEnvir.ProgramStatus) // required status
          .addWarnings|addAllWarnings(io.resys.hdes.client.api.programs.ProgramEnvir.ProgramMessage) // warnings elements
          .addErrors|addAllErrors(io.resys.hdes.client.api.programs.ProgramEnvir.ProgramMessage) // errors elements
          .addHeaders|addAllHeaders(io.resys.hdes.client.api.ast.TypeDef) // headers elements
          .addAssociations|addAllAssociations(io.resys.hdes.client.api.programs.ProgramEnvir.ProgramAssociation) // associations elements
          .source(io.resys.hdes.client.api.ast.AstBody.AstSource) // required source
          .ast(A) // optional ast
          .program(P) // optional program
          .build();
       
      Type Parameters:
      A - generic parameter A
      P - generic parameter P
      Returns:
      A new ImmutableProgramWrapper builder