Class ImmutableProcedureMeta

java.lang.Object
org.nuiton.db.meta.ImmutableProcedureMeta
All Implemented Interfaces:
ProcedureMeta

@Generated(from="ProcedureMeta", generator="Immutables") @ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableProcedureMeta extends Object implements ProcedureMeta
Immutable implementation of ProcedureMeta.

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

  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface ProcedureMeta
      Returns:
      The value of the name attribute
    • getArgs

      public com.google.common.collect.ImmutableList<ArgumentMeta> getArgs()
      Specified by:
      getArgs in interface ProcedureMeta
      Returns:
      The value of the args attribute
    • getComment

      public Optional<String> getComment()
      Specified by:
      getComment in interface ProcedureMeta
      Returns:
      The value of the comment attribute
    • withName

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

      public final ImmutableProcedureMeta withArgs(ArgumentMeta... elements)
      Copy the current immutable object with elements that replace the content of args.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withArgs

      public final ImmutableProcedureMeta withArgs(Iterable<? extends ArgumentMeta> elements)
      Copy the current immutable object with elements that replace the content of args. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of args elements to set
      Returns:
      A modified copy or this if not changed
    • withComment

      public final ImmutableProcedureMeta withComment(String value)
      Copy the current immutable object by setting a present value for the optional comment attribute.
      Parameters:
      value - The value for comment
      Returns:
      A modified copy or this if not changed
    • withComment

      public final ImmutableProcedureMeta withComment(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the comment attribute. An equality check is used on inner value to prevent copying of the same value by returning this.
      Parameters:
      optional - An optional value for comment
      Returns:
      A modified copy or this if not changed
    • equals

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

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

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

      public static ImmutableProcedureMeta.Builder builder()
      Creates a builder for ImmutableProcedureMeta.
      ImmutableProcedureMeta.builder()
         .name(String) // required name
         .addArgs|addAllArgs(org.nuiton.db.meta.ArgumentMeta) // args elements
         .comment(Optional<String>) // optional comment
         .build();
      
      Returns:
      A new ImmutableProcedureMeta builder