Class ImmutableAstSource

java.lang.Object
io.resys.hdes.client.api.ast.ImmutableAstSource
All Implemented Interfaces:
AstBody.AstSource, Serializable

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

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

See Also:
  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface AstBody.AstSource
      Returns:
      The value of the id attribute
    • getHash

      public String getHash()
      Specified by:
      getHash in interface AstBody.AstSource
      Returns:
      The value of the hash attribute
    • getBodyType

      public AstBody.AstBodyType getBodyType()
      Specified by:
      getBodyType in interface AstBody.AstSource
      Returns:
      The value of the bodyType attribute
    • getCommands

      public com.google.common.collect.ImmutableList<AstCommand> getCommands()
      Specified by:
      getCommands in interface AstBody.AstSource
      Returns:
      The value of the commands attribute
    • withId

      public final ImmutableAstSource 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
    • withHash

      public final ImmutableAstSource withHash(String value)
      Copy the current immutable object by setting a value for the hash attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hash
      Returns:
      A modified copy of the this object
    • withBodyType

      public final ImmutableAstSource withBodyType(AstBody.AstBodyType value)
      Copy the current immutable object by setting a value for the bodyType attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for bodyType
      Returns:
      A modified copy of the this object
    • withCommands

      public final ImmutableAstSource withCommands(AstCommand... elements)
      Copy the current immutable object with elements that replace the content of commands.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withCommands

      public final ImmutableAstSource withCommands(Iterable<? extends AstCommand> elements)
      Copy the current immutable object with elements that replace the content of commands. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of commands 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 ImmutableAstSource 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, hash, bodyType, commands.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

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

      public static ImmutableAstSource copyOf(AstBody.AstSource instance)
      Creates an immutable copy of a AstBody.AstSource 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 AstSource instance
    • builder

      public static ImmutableAstSource.Builder builder()
      Creates a builder for ImmutableAstSource.
       ImmutableAstSource.builder()
          .id(String) // required id
          .hash(String) // required hash
          .bodyType(io.resys.hdes.client.api.ast.AstBody.AstBodyType) // required bodyType
          .addCommands|addAllCommands(io.resys.hdes.client.api.ast.AstCommand) // commands elements
          .build();
       
      Returns:
      A new ImmutableAstSource builder