Package org.verifyica.api
Interface Argument<T>
- Type Parameters:
T- the payload type
- All Superinterfaces:
Named
- All Known Implementing Classes:
Argument.Empty
Argument is a container that associates a name with a given payload.-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetName()Method to get the nameMethod to get the Argument payloaddefault <V> VgetPayload(Class<V> type) Method to get the Argument payloaddefault booleanMethod to return if the Argument has a non-null payloaddefault Stringname()Method to get the namestatic voidMethod to validate a String is not null and not blank, throwing an IllegalArgumentException if it is null or blankstatic voidMethod to validate an Object is not null, throwing an IllegalArgumentException if it is nullstatic <T> Argument<T> Method to create an Argument of type Tstatic Argument<BigDecimal> ofBigDecimal(BigDecimal value) Method to create an Argument of type BigDecimalstatic Argument<BigInteger> ofBigInteger(BigInteger value) Method to create an Argument of type BigIntegerofBoolean(boolean value) Method to create an Argument of type booleanofByte(byte value) Method to create an Argument of type byteofChar(char value) Method to create an Argument of type charofDouble(double value) Method to create an Argument of type doubleofFloat(float value) Method to create an Argument of type floatofInt(int value) Method to create an Argument of type intofLong(long value) Method to create an Argument of type longofShort(short value) Method to create an Argument of type shortMethod to create an Argument of type Stringdefault Tpayload()Method to get the Argument payloaddefault <V> VMethod to get the Argument payload
-
Field Details
-
EMPTY
Empty Argument
-
-
Method Details
-
name
Description copied from interface:NamedMethod to get the name -
getName
String getName()Description copied from interface:NamedMethod to get the name -
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
Method to get the Argument payload- Type Parameters:
V- the return type- Parameters:
type- type- Returns:
- the Argument payload
-
getPayload
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
Method to create an Argument of type boolean- Parameters:
value- value- Returns:
- an Argument
-
ofByte
Method to create an Argument of type byte- Parameters:
value- value- Returns:
- an Argument
-
ofChar
Method to create an Argument of type char- Parameters:
value- value- Returns:
- an Argument
-
ofShort
Method to create an Argument of type short- Parameters:
value- value- Returns:
- an Argument
-
ofInt
Method to create an Argument of type int- Parameters:
value- value- Returns:
- an Argument
-
ofLong
Method to create an Argument of type long- Parameters:
value- value- Returns:
- an Argument
-
ofFloat
Method to create an Argument of type float- Parameters:
value- value- Returns:
- an Argument
-
ofDouble
Method to create an Argument of type double- Parameters:
value- value- Returns:
- an Argument
-
ofString
Method to create an Argument of type String- Parameters:
value- value- Returns:
- an Argument
-
ofBigInteger
Method to create an Argument of type BigInteger- Parameters:
value- value- Returns:
- an Argument
-
ofBigDecimal
Method to create an Argument of type BigDecimal- Parameters:
value- value- Returns:
- an Argument
-
of
Method to create an Argument of type T- Type Parameters:
T- type T- Parameters:
name- namepayload- payload- Returns:
- an Argument
-
notNull
Method to validate an Object is not null, throwing an IllegalArgumentException if it is null- Parameters:
object- objectmessage- message
-
notBlank
Method to validate a String is not null and not blank, throwing an IllegalArgumentException if it is null or blank- Parameters:
string- stringnullMessage- nullMessageblankMessage- blankMessage
-