Top Description Fields Constructors Methods
org.junit.platform.engine

public Class FilterResult

extends Object
Class Inheritance
Annotations
@API
status:STABLE
since:1.0
Static Imports
org.apiguardian.api.API.Status.STABLE

The result of applying a Filter.
Since
1.0

Field Summary

Modifier and TypeField and Description
private final boolean
private final Optional<String>

Constructor Summary

AccessConstructor and Description
private
FilterResult(boolean included, @Nullable String reason)

Method Summary

Modifier and TypeMethod and Description
public static FilterResult

Returns:

an excluded FilterResult with the given reason
excluded
(@Nullable String
the reason why the filtered object was excluded
reason
)

Factory for creating excluded results.

public boolean

Returns:

true if the filtered object should be excluded
excluded
()

Returns true if the filtered object should be excluded.

public Optional<String>
getReason()

Get the reason why the filtered object should be included or excluded, if available.

public static FilterResult

Returns:

an included FilterResult with the given reason
included
(@Nullable String
the reason why the filtered object was included
reason
)

Factory for creating included results.

public boolean

Returns:

true if the filtered object should be included
included
()

Returns true if the filtered object should be included.

public static FilterResult

Returns:

a valid FilterResult for the given condition
includedIf
(boolean
whether the filtered object should be included
included
)

Factory for creating filter results based on the condition given.

public static FilterResult

Returns:

a valid FilterResult for the given condition
includedIf
(boolean
whether the filtered object should be included
included
,
Supplier<@Nullable String>
supplier for the reason in case of inclusion
inclusionReasonSupplier
,
Supplier<@Nullable String>
supplier for the reason in case of exclusion
exclusionReasonSupplier
)

Factory for creating filter results based on the condition given.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

includedback to summary
private final boolean included
reasonback to summary
private final Optional<String> reason

Constructor Detail

FilterResultback to summary
private FilterResult(boolean included, @Nullable String reason)

Method Detail

excludedback to summary
public static FilterResult excluded(@Nullable String reason)

Factory for creating excluded results.

Parameters
reason:@Nullable String

the reason why the filtered object was excluded

Returns:FilterResult

an excluded FilterResult with the given reason

excludedback to summary
public boolean excluded()

Returns true if the filtered object should be excluded.

Returns:boolean

true if the filtered object should be excluded

getReasonback to summary
public Optional<String> getReason()

Get the reason why the filtered object should be included or excluded, if available.

includedback to summary
public static FilterResult included(@Nullable String reason)

Factory for creating included results.

Parameters
reason:@Nullable String

the reason why the filtered object was included

Returns:FilterResult

an included FilterResult with the given reason

includedback to summary
public boolean included()

Returns true if the filtered object should be included.

Returns:boolean

true if the filtered object should be included

includedIfback to summary
public static FilterResult includedIf(boolean included)

Factory for creating filter results based on the condition given.

Parameters
included:boolean

whether the filtered object should be included

Returns:FilterResult

a valid FilterResult for the given condition

includedIfback to summary
public static FilterResult includedIf(boolean included, Supplier<@Nullable String> inclusionReasonSupplier, Supplier<@Nullable String> exclusionReasonSupplier)

Factory for creating filter results based on the condition given.

Parameters
included:boolean

whether the filtered object should be included

inclusionReasonSupplier:Supplier<@Nullable String>

supplier for the reason in case of inclusion

exclusionReasonSupplier:Supplier<@Nullable String>

supplier for the reason in case of exclusion

Returns:FilterResult

a valid FilterResult for the given condition

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override