T
- The type of the target value of the instance of this interface.E
- The type of the target value of the checker instance.
In most cases, the same type as T
is chosen.public interface ObjectTransformer<T,E> extends AbstractObjectTransformer<ObjectTransformer<T,E>,ObjectChecker<T,E>,T,E>
This interface is used for object whose type doesn’t have an explicit support. Do not try to extend/implement this class to support your own class.
Modifier and Type | Interface and Description |
---|---|
static class |
ObjectTransformer.Impl<T,E> |
Transformer.Base<TX extends Transformer<TX,V,T,R>,V extends Checker<V,T,R>,T,R>
Matcher.JunctionType
Modifier and Type | Method and Description |
---|---|
default BooleanTransformer<T> |
asBoolean()
Lets the framework know the value to be checked is a
Boolean . |
default DoubleTransformer<T> |
asDouble()
Lets the framework know the value to be checked is a
Double . |
default FloatTransformer<T> |
asFloat()
Lets the framework know the value to be checked is a
Float . |
default IntegerTransformer<T> |
asInteger()
Lets the framework know the value to be checked is a
Integer . |
default <EE> ListTransformer<T,EE> |
asList()
Lets the framework know the value to be checked is a
List . |
default <EE> ListTransformer<T,EE> |
asListOf(Class<EE> type)
Lets the framework know the value to be checked is a
List of EE . |
default LongTransformer<T> |
asLong()
Lets the framework know the value to be checked is a
Long . |
default ShortTransformer<T> |
asShort()
Lets the framework know the value to be checked is a
Short . |
default StringTransformer<T> |
asString()
Lets the framework know the value to be checked is a
String . |
static <E> ObjectTransformer<E,E> |
create(Supplier<E> value)
Creates a new Object transformer whose target value is given by a supplier.
|
default ObjectTransformer<T,E> |
transform(Function<ObjectTransformer<T,E>,Predicate<E>> clause) |
asObject, expectException, function, invoke, invokeStatic, stringify, toBoolean, toDouble, toFloat, toInteger, toList, toLong, toObject, toShort, toStream, toString, toThrowable
addTransformAndCheckClause, satisfies, satisfies, then, toBe, transformValueWith
allOf, anyOf, toPredicate, transformFunction
booleanValue, createPredicateForAllOf, doubleValue, floatValue, integerValue, listValue, longValue, objectValue, shortValue, statementPredicate, statementValue, streamValue, stringValue, throwableValue
default ObjectTransformer<T,E> transform(Function<ObjectTransformer<T,E>,Predicate<E>> clause)
default StringTransformer<T> asString()
Lets the framework know the value to be checked is a String
.
This method may throw an exception, if the value is not a String
.
<T>
object.default IntegerTransformer<T> asInteger()
Lets the framework know the value to be checked is a Integer
.
This method may throw an exception, if the value is not a Integer
.
<T>
object.default LongTransformer<T> asLong()
Lets the framework know the value to be checked is a Long
.
This method may throw an exception, if the value is not a Long
.
<T>
object.default ShortTransformer<T> asShort()
Lets the framework know the value to be checked is a Short
.
This method may throw an exception, if the value is not a Short
.
<T>
object.default DoubleTransformer<T> asDouble()
Lets the framework know the value to be checked is a Double
.
This method may throw an exception, if the value is not a Double
.
<T>
object.default FloatTransformer<T> asFloat()
Lets the framework know the value to be checked is a Float
.
This method may throw an exception, if the value is not a Float
.
<T>
object.default BooleanTransformer<T> asBoolean()
Lets the framework know the value to be checked is a Boolean
.
This method may throw an exception, if the value is not a Boolean
.
<T>
object.default <EE> ListTransformer<T,EE> asListOf(Class<EE> type)
Lets the framework know the value to be checked is a List
of EE
.
This method may throw an exception, if the value is not a List
.
<EE>
object.default <EE> ListTransformer<T,EE> asList()
Lets the framework know the value to be checked is a List
.
This method may throw an exception, if the value is not a List
.
<T>
object.static <E> ObjectTransformer<E,E> create(Supplier<E> value)
Creates a new Object transformer whose target value is given by a supplier.
E
- The type of the target value.value
- A supplier of the target value.Copyright © 2024. All rights reserved.