Interface Argument<T>

Type Parameters:
T - the payload type
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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Class to implement Empty
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Argument<Object>
    Empty Argument
  • Method Summary

    Modifier and Type
    Method
    Description
    Method to get the name
    Method to get the Argument payload
    default <V> V
    getPayload(Class<V> type)
    Method to get the Argument payload
    default boolean
    Method to return if the Argument has a non-null payload
    default String
    Method to get the name
    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
    static void
    notNull(Object object, String message)
    Method to validate an Object is not null, throwing an IllegalArgumentException if it is null
    static <T> Argument<T>
    of(String name, T payload)
    Method to create an Argument of type T
    Method to create an Argument of type BigDecimal
    Method to create an Argument of type BigInteger
    ofBoolean(boolean value)
    Method to create an Argument of type boolean
    static Argument<Byte>
    ofByte(byte value)
    Method to create an Argument of type byte
    ofChar(char value)
    Method to create an Argument of type char
    ofDouble(double value)
    Method to create an Argument of type double
    static Argument<Float>
    ofFloat(float value)
    Method to create an Argument of type float
    ofInt(int value)
    Method to create an Argument of type int
    static Argument<Long>
    ofLong(long value)
    Method to create an Argument of type long
    static Argument<Short>
    ofShort(short value)
    Method to create an Argument of type short
    Method to create an Argument of type String
    default T
    Method to get the Argument payload
    default <V> V
    payload(Class<V> type)
    Method to get the Argument payload
  • Field Details

  • Method Details

    • name

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

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

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

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

      default <V> V payload(Class<V> type)
      Method to get the Argument payload
      Type Parameters:
      V - the return type
      Parameters:
      type - type
      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 non-null 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