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, String reason)

Method Summary

Modifier and TypeMethod and Description
public static FilterResult

Returns:

an excluded FilterResult with the given reason
excluded
(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
()

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
(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
()

public static FilterResult

Returns:

a valid FilterResult for the given condition
includedIf
(boolean
whether or not 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 or not the filtered object should be included
included
,
Supplier<String>
supplier for the reason in case of inclusion
inclusionReasonSupplier
,
Supplier<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, String reason)

Method Detail

excludedback to summary
public static FilterResult excluded(String reason)

Factory for creating excluded results.

Parameters
reason: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: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(String reason)

Factory for creating included results.

Parameters
reason: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: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 or not 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<String> inclusionReasonSupplier, Supplier<String> exclusionReasonSupplier)

Factory for creating filter results based on the condition given.

Parameters
included:boolean

whether or not the filtered object should be included

inclusionReasonSupplier:Supplier<String>

supplier for the reason in case of inclusion

exclusionReasonSupplier:Supplier<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.

Returns:String

a string representation of the object

Annotations
@Override