Class ImmutableArgumentMeta

java.lang.Object
org.nuiton.db.meta.ImmutableArgumentMeta
All Implemented Interfaces:
ArgumentMeta

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

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

  • Method Details

    • getType

      public String getType()
      Specified by:
      getType in interface ArgumentMeta
      Returns:
      The value of the type attribute
    • getName

      public Optional<String> getName()
      Specified by:
      getName in interface ArgumentMeta
      Returns:
      The value of the name attribute
    • withType

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

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

      public final ImmutableArgumentMeta withName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the name 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 name
      Returns:
      A modified copy or this if not changed
    • equals

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

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

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

      public static ImmutableArgumentMeta.Builder builder()
      Creates a builder for ImmutableArgumentMeta.
      ImmutableArgumentMeta.builder()
         .type(String) // required type
         .name(Optional<String>) // optional name
         .build();
      
      Returns:
      A new ImmutableArgumentMeta builder