Class Constructor<T>
- java.lang.Object
-
- net.andreinc.mockneat.unit.objects.Constructor<T>
-
-
Constructor Summary
Constructors Constructor Description Constructor(java.lang.Class<T> cls)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> Constructor<T>constructor(java.lang.Class<T> cls)Returns a newConstructorobject.Constructor<T>params(java.lang.Object... params)Specifies the values which are supplied to the constructor.java.util.function.Supplier<T>supplier()This is the sole abstract method of the interface.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.andreinc.mockneat.abstraction.MockUnit
array, array, collection, collection, collection, collection, collection, collection, consume, consume, get, get, list, list, list, list, list, list, map, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapKeys, mapToDouble, mapToInt, mapToLocalDate, mapToLong, mapToString, mapToString, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, mapVals, serialize, set, set, set, set, set, set, stream, val, val, valStr, valStr
-
-
-
-
Constructor Detail
-
Constructor
public Constructor(java.lang.Class<T> cls)
-
-
Method Detail
-
constructor
public static <T> Constructor<T> constructor(java.lang.Class<T> cls)
Returns a new
Constructorobject.This method can be used to generate
MockUnit<T>from a Java Bean<T>by accessing it's constructor and supply it with arbitrary input.- Type Parameters:
T- The type ofMockUnit<T>. This is the wrapped type.- Parameters:
cls- The class for type<T>. (Eg.: Student.class)- Returns:
- A new
Constructorobject. TheConstructorclass implementsMockUnit<T>.
-
params
public Constructor<T> params(java.lang.Object... params)
Specifies the values which are supplied to the constructor.
As a param you can supply a
MockUnit<T>or a constant value. If you chose to supplyMockUnits theval()method will be automatically invoked.- Parameters:
params- A var-arg array of constant values orMockUnits.- Returns:
- The current
Constructorinstance.
-
-