Class FluentAnyAssertion<T,R> 
- Type Parameters:
- T- The object type.
- R- The return type.
- Direct Known Subclasses:
- AnyAssertion
 Extends from FluentObjectAssertion allowing you to perform basic assertions, but adds several transform
 methods to convert to more-specific assertion types.
 
Example:
   
Test Methods:
Transform Methods:
- FluentAnyAssertion- asArray(Class)
- asIntArray()
- asLongArray()
- asShortArray()
- asFloatArray()
- asDoubleArray()
- asCharArray()
- asByteArray()
- asBooleanArray()
- asBoolean()
- asBytes()
- asCollection()
- asCollection(Class)
- asStringList()
- asComparable()
- asDate()
- asInteger()
- asLong()
- asList()
- asList(Class)
- asMap()
- asMap(Class,Class)
- asBean()
- asBean(Class)
- asBeanList(Class)
- asZonedDateTime()
 
- FluentObjectAssertion
Configuration Methods:
See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionFluentAnyAssertion(Assertion creator, T value, R returns) Chained constructor.FluentAnyAssertion(T value, R returns) Constructor.
- 
Method SummaryModifier and TypeMethodDescription<E> FluentArrayAssertion<E,R> Converts this object assertion into an array assertion.asBean()Converts this object assertion into a bean assertion.<T2> FluentBeanAssertion<T2,R> Converts this object assertion into a bean assertion.<T2> FluentBeanListAssertion<T2,R> asBeanList(Class<T2> beanType) Converts this object assertion into a list-of-beans assertion.Converts this object assertion into a boolean assertion.FluentPrimitiveArrayAssertion<Boolean,boolean[], R> Converts this object assertion into a primitive boolean array assertion.FluentPrimitiveArrayAssertion<Byte,byte[], R> Converts this object assertion into a primitive byte array assertion.asBytes()Converts this object assertion into a byte array assertion.FluentPrimitiveArrayAssertion<Character,char[], R> Converts this object assertion into a primitive char array assertion.Converts this object assertion into a collection assertion.<E> FluentCollectionAssertion<E,R> asCollection(Class<E> elementType) Converts this object assertion into a collection assertion.<T2 extends Comparable<T2>>
 FluentComparableAssertion<T2,R> Converts this object assertion into a comparable object assertion.asDate()Converts this object assertion into a date assertion.FluentPrimitiveArrayAssertion<Double,double[], R> Converts this object assertion into a primitive double array assertion.FluentPrimitiveArrayAssertion<Float,float[], R> Converts this object assertion into a primitive float array assertion.Converts this object assertion into a primitive int array assertion.Converts this object assertion into an integer assertion.asList()Converts this object assertion into a list assertion.<E> FluentListAssertion<E,R> Converts this object assertion into a list assertion.asLong()Converts this object assertion into a long assertion.FluentPrimitiveArrayAssertion<Long,long[], R> Converts this object assertion into a primitive long array assertion.asMap()Converts this object assertion into a map assertion.<K,V> FluentMapAssertion<K, V, R> Converts this object assertion into a map assertion with the specified key and value types.FluentPrimitiveArrayAssertion<Short,short[], R> Converts this object assertion into a primitive short array assertion.Converts this object assertion into a collection assertion.Converts this object assertion into a zoned-datetime assertion.Allows you to override the assertion failure message.setOut(PrintStream value) If an error occurs, send the error message to the specified stream instead of STDERR.Suppresses output to STDERR.If an error occurs, send the error message to STDOUT instead of STDERR.setThrowable(Class<? extends RuntimeException> value) If an error occurs, throw this exception instead of the standardAssertionError.Methods inherited from class org.apache.juneau.assertions.FluentObjectAssertionasAny, asJson, asJsonSorted, asString, asString, asString, asTransformed, asTransformedTo, equals, getFailureMessage, is, is, isAny, isExactType, isExists, isJson, isNot, isNotAny, isNotNull, isNull, isSame, isSameJsonAs, isSameSerializedAs, isSameSortedJsonAs, isString, isType, map, opt, orElse, toString, value, valueAsString, valueIsNotNull, valueIsNullMethods inherited from class org.apache.juneau.assertions.FluentAssertionreturnsMethods inherited from class org.apache.juneau.assertions.AssertionarrayClass, className, error, error
- 
Constructor Details- 
FluentAnyAssertionConstructor.- Parameters:
- value- The object being tested.
 Can be- null .
- returns- The object to return after a test method is called.
 If- null , the test method returns this object allowing multiple test method calls to be used on the same assertion.
 
- 
FluentAnyAssertionChained constructor.Used when transforming one assertion into another so that the assertion config can be used by the new assertion. - Parameters:
- creator- The assertion that created this assertion.
 Should be- null if this is the top-level assertion.
- value- The object being tested.
 Can be- null .
- returns- The object to return after a test method is called.
 If- null , the test method returns this object allowing multiple test method calls to be used on the same assertion.
 
 
- 
- 
Method Details- 
asArrayConverts this object assertion into an array assertion.- Type Parameters:
- E- The element type of the array.
- Parameters:
- elementType- The element type of the array.
- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an array.
 
- 
asIntArrayConverts this object assertion into a primitive int array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an int array.
 
- 
asLongArrayConverts this object assertion into a primitive long array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an long array.
 
- 
asShortArrayConverts this object assertion into a primitive short array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an short array.
 
- 
asFloatArrayConverts this object assertion into a primitive float array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an float array.
 
- 
asDoubleArrayConverts this object assertion into a primitive double array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an double array.
 
- 
asCharArrayConverts this object assertion into a primitive char array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an char array.
 
- 
asByteArrayConverts this object assertion into a primitive byte array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an byte array.
 
- 
asBooleanArrayConverts this object assertion into a primitive boolean array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an boolean array.
 
- 
asBooleanConverts this object assertion into a boolean assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a boolean.
 
- 
asBytesConverts this object assertion into a byte array assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a byte array.
 
- 
asCollectionConverts this object assertion into a collection assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a collection.
 
- 
asCollectionConverts this object assertion into a collection assertion.- Type Parameters:
- E- The element type of the collection.
- Parameters:
- elementType- The element type of the collection.
- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a collection.
 
- 
asStringListConverts this object assertion into a collection assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a collection.
 
- 
asComparableConverts this object assertion into a comparable object assertion.- Type Parameters:
- T2- The comparable type.
- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an instance of- Comparable.
 
- 
asDateConverts this object assertion into a date assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a date.
 
- 
asIntegerConverts this object assertion into an integer assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not an integer.
 
- 
asLongConverts this object assertion into a long assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a long.
 
- 
asListConverts this object assertion into a list assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a list.
 
- 
asListConverts this object assertion into a list assertion.- Type Parameters:
- E- The element type.
- Parameters:
- elementType- The element type.
- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a list.
 
- 
asMapConverts this object assertion into a map assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a map.
 
- 
asMapConverts this object assertion into a map assertion with the specified key and value types.- Type Parameters:
- K- The key type.
- V- The value type.
- Parameters:
- keyType- The key type.
- valueType- The value type.
- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a map.
 
- 
asBeanConverts this object assertion into a bean assertion.- Type Parameters:
- T2- The bean type.
- Parameters:
- beanType- The bean type.
- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a bean.
 
- 
asBeanConverts this object assertion into a bean assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a bean.
 
- 
asBeanListConverts this object assertion into a list-of-beans assertion.- Type Parameters:
- T2- The bean type.
- Parameters:
- beanType- The bean type.
- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a bean.
 
- 
asZonedDateTimeConverts this object assertion into a zoned-datetime assertion.- Returns:
- A new assertion.
- Throws:
- AssertionError- If object is not a zoned-datetime.
 
- 
setMsgDescription copied from class:AssertionAllows you to override the assertion failure message.String can contain "{msg}" to represent the original message.Example:import static org.apache.juneau.assertions.Assertions.*;// Throws an assertion with a custom message instead of the default "Value was null." assertString (myString ) .setMsg("My string was bad: {msg}" ) .isNotNull();- Overrides:
- setMsgin class- FluentObjectAssertion<T,- R> 
- Parameters:
- msg- The assertion failure message.
- args- Optional message arguments.
- Returns:
- This object.
 
- 
setOutDescription copied from class:AssertionIf an error occurs, send the error message to the specified stream instead of STDERR.- Overrides:
- setOutin class- FluentObjectAssertion<T,- R> 
- Parameters:
- value- The output stream. Can be- null to suppress output.
- Returns:
- This object.
 
- 
setSilentDescription copied from class:AssertionSuppresses output to STDERR.This is the equivalent to calling out( .null )- Overrides:
- setSilentin class- FluentObjectAssertion<T,- R> 
- Returns:
- This object.
 
- 
setStdOutDescription copied from class:AssertionIf an error occurs, send the error message to STDOUT instead of STDERR.- Overrides:
- setStdOutin class- FluentObjectAssertion<T,- R> 
- Returns:
- This object.
 
- 
setThrowableDescription copied from class:AssertionIf an error occurs, throw this exception instead of the standardAssertionError.The throwable class must have a public constructor that takes in any of the following parameters: If the throwable cannot be instantiated, a RuntimeExceptionis thrown instead.Example:import static org.apache.juneau.assertions.Assertions.*;// Throws a BadRequest instead of an AssertionError if the string is null. assertString (myString ) .setThrowable(BadRequest.class ) .isNotNull();- Overrides:
- setThrowablein class- FluentObjectAssertion<T,- R> 
- Parameters:
- value- The new value for this setting.
- Returns:
- This object.
 
 
-