Class ImmutableStoreEntity

java.lang.Object
io.resys.hdes.client.api.ImmutableStoreEntity
All Implemented Interfaces:
HdesStore.StoreEntity

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

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

  • Method Details

    • getId

      public String getId()
      Specified by:
      getId in interface HdesStore.StoreEntity
      Returns:
      The value of the id attribute
    • getBodyType

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

      public String getHash()
      Specified by:
      getHash in interface HdesStore.StoreEntity
      Returns:
      The value of the hash attribute
    • getBody

      public com.google.common.collect.ImmutableList<AstCommand> getBody()
      Specified by:
      getBody in interface HdesStore.StoreEntity
      Returns:
      The value of the body attribute
    • withId

      public final ImmutableStoreEntity 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
    • withBodyType

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

      public final ImmutableStoreEntity 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
    • withBody

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

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

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

      public static ImmutableStoreEntity copyOf(HdesStore.StoreEntity instance)
      Creates an immutable copy of a HdesStore.StoreEntity 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 StoreEntity instance
    • builder

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