Interface Argument<T>

Type Parameters:
T - the type of the payload
All Superinterfaces:
Named
All Known Implementing Classes:
Argument.Empty

public interface Argument<T> extends Named
Argument is a container that associates a name with a given payload.
Since:
5.8
  • Field Details

  • Method Details

    • getName

      String getName()
      Description copied from interface: Named
      Method to get the name
      Specified by:
      getName in interface Named
      Returns:
      the name
    • getPayload

      T getPayload()
      Method to get the Argument payload
      Returns:
      the Argument payload
    • getPayload

      default <V> V getPayload(Class<V> type)
      Method to get the Argument payload
      Type Parameters:
      V - the return type
      Parameters:
      type - type
      Returns:
      the Argument payload
    • hasPayload

      default boolean hasPayload()
      Method to return if the Argument has a payload
      Returns:
      true if the Argument payload is not null, else false
    • ofBoolean

      static Argument<Boolean> ofBoolean(boolean value)
      Method to create an Argument of type boolean
      Parameters:
      value - value
      Returns:
      an Argument
    • ofByte

      static Argument<Byte> ofByte(byte value)
      Method to create an Argument of type byte
      Parameters:
      value - value
      Returns:
      an Argument
    • ofChar

      static Argument<Character> ofChar(char value)
      Method to create an Argument of type char
      Parameters:
      value - value
      Returns:
      an Argument
    • ofShort

      static Argument<Short> ofShort(short value)
      Method to create an Argument of type short
      Parameters:
      value - value
      Returns:
      an Argument
    • ofInt

      static Argument<Integer> ofInt(int value)
      Method to create an Argument of type int
      Parameters:
      value - value
      Returns:
      an Argument
    • ofLong

      static Argument<Long> ofLong(long value)
      Method to create an Argument of type long
      Parameters:
      value - value
      Returns:
      an Argument
    • ofFloat

      static Argument<Float> ofFloat(float value)
      Method to create an Argument of type float
      Parameters:
      value - value
      Returns:
      an Argument
    • ofDouble

      static Argument<Double> ofDouble(double value)
      Method to create an Argument of type double
      Parameters:
      value - value
      Returns:
      an Argument
    • ofString

      static Argument<String> ofString(String value)
      Method to create an Argument of type String
      Parameters:
      value - value
      Returns:
      an Argument
    • ofBigInteger

      static Argument<BigInteger> ofBigInteger(BigInteger value)
      Method to create an Argument of type BigInteger
      Parameters:
      value - value
      Returns:
      an Argument
    • ofBigDecimal

      static Argument<BigDecimal> ofBigDecimal(BigDecimal value)
      Method to create an Argument of type BigDecimal
      Parameters:
      value - value
      Returns:
      an Argument
    • of

      static <T> Argument<T> of(String name, T payload)
      Method to create an Argument of type T
      Type Parameters:
      T - type T
      Parameters:
      name - name
      payload - payload
      Returns:
      an Argument
    • notNull

      static void notNull(Object object, String message)
      Method to validate an Object is not null, throwing an IllegalArgumentException if it is null
      Parameters:
      object - object
      message - message
    • notBlank

      static void notBlank(String string, String nullMessage, String blankMessage)
      Method to validate a String is not null and not blank, throwing an IllegalArgumentException if it is null or blank
      Parameters:
      string - string
      nullMessage - nullMessage
      blankMessage - blankMessage