Module nl.jqno.equalsverifier
Class ConcreteValues
java.lang.Object
nl.jqno.equalsverifier.internal.instantiators.ConcreteValues
- All Implemented Interfaces:
Values
Simple container for primitive and object values used to define a provided instantiator. This implementation of the
Values interface is mutable so a collection of values can be constructed easily.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TReturns the value stored under the given field name, cast to the desired type.booleangetBoolean(String fieldName) Returns thebooleanvalue stored under the given field name.byteReturns thebytevalue stored under the given field name.charReturns thecharvalue stored under the given field name.doubleReturns thedoublevalue stored under the given field name.floatReturns thefloatvalue stored under the given field name.intReturns theintvalue stored under the given field name.longReturns thelongvalue stored under the given field name.shortReturns theshortvalue stored under the given field name.Returns theStringvalue stored under the given field name.static ConcreteValuesCreates an instance ofConcreteValuesfrom a Map.voidStores a value under the given field name.private <T> T
-
Field Details
-
values
-
throwing
private final boolean throwing
-
-
Constructor Details
-
ConcreteValues
private ConcreteValues(boolean throwing)
-
-
Method Details
-
of
Creates an instance ofConcreteValuesfrom a Map.- Parameters:
values- The values to add to the new instance.throwing- Whether or not to throw when an unknown value is requested.- Returns:
- An instance of
ConcreteValueswith the given values.
-
put
Stores a value under the given field name.- Parameters:
fieldName- the name of the fieldvalue- the value to store
-
getBoolean
Returns thebooleanvalue stored under the given field name.- Specified by:
getBooleanin interfaceValues- Parameters:
fieldName- the name of the field- Returns:
- the stored
booleanvalue
-
getByte
Returns thebytevalue stored under the given field name. -
getChar
Returns thecharvalue stored under the given field name. -
getDouble
Returns thedoublevalue stored under the given field name. -
getFloat
Returns thefloatvalue stored under the given field name. -
getInt
Returns theintvalue stored under the given field name. -
getLong
Returns thelongvalue stored under the given field name. -
getShort
Returns theshortvalue stored under the given field name. -
getString
Returns theStringvalue stored under the given field name. -
get
Returns the value stored under the given field name, cast to the desired type. -
safe
-