public class OptionalShouldContain extends BasicErrorMessageFactory
Optional
, OptionalDouble
, OptionalInt
or OptionalLong
should contain a specific value.arguments, format
Modifier and Type | Method and Description |
---|---|
static OptionalShouldContain |
shouldContain(Object expectedValue)
Indicates that an
Optional is empty so it doesn't contain the expected value. |
static <VALUE> OptionalShouldContain |
shouldContain(Optional<VALUE> optional,
VALUE expectedValue)
Indicates that the provided
Optional does not contain the provided argument. |
static OptionalShouldContain |
shouldContain(OptionalDouble optional,
double expectedValue)
Indicates that the provided
OptionalDouble does not contain the provided argument. |
static OptionalShouldContain |
shouldContain(OptionalInt optional,
int expectedValue)
Indicates that the provided
OptionalInt does not contain the provided argument. |
static OptionalShouldContain |
shouldContain(OptionalLong optional,
long expectedValue)
Indicates that the provided
OptionalLong does not contain the provided argument. |
static <VALUE> OptionalShouldContain |
shouldContainSame(Optional<VALUE> optional,
VALUE expectedValue)
Indicates that the provided
Optional does not contain the provided argument (judging by reference
equality). |
create, create, create, equals, hashCode, toString, unquotedString
public static <VALUE> OptionalShouldContain shouldContain(Optional<VALUE> optional, VALUE expectedValue)
Optional
does not contain the provided argument.public static OptionalShouldContain shouldContain(OptionalDouble optional, double expectedValue)
OptionalDouble
does not contain the provided argument.optional
- the OptionalDouble
which contains a value.expectedValue
- the value we expect to be in the provided OptionalDouble
.public static OptionalShouldContain shouldContain(OptionalInt optional, int expectedValue)
OptionalInt
does not contain the provided argument.optional
- the OptionalInt
which contains a value.expectedValue
- the value we expect to be in the provided OptionalInt
.public static OptionalShouldContain shouldContain(OptionalLong optional, long expectedValue)
OptionalLong
does not contain the provided argument.optional
- the OptionalLong
which contains a value.expectedValue
- the value we expect to be in the provided OptionalLong
.public static <VALUE> OptionalShouldContain shouldContainSame(Optional<VALUE> optional, VALUE expectedValue)
Optional
does not contain the provided argument (judging by reference
equality).public static OptionalShouldContain shouldContain(Object expectedValue)
Optional
is empty so it doesn't contain the expected value.expectedValue
- the value we expect to be in an Optional
.Copyright © 2014–2019 AssertJ. All rights reserved.