Top Description Fields Constructors Methods
net.bytebuddy.matcher

public Class BooleanMatcher<T>

extends ElementMatcher.Junction.AbstractBase<T>
Class Inheritance
Annotations
@Enhance
Type Parameters
<T>
The actual matched type of this matcher.
Imports
net.bytebuddy.build.HashCodeAndEqualsPlugin, net.bytebuddy.utility.nullability.MaybeNull

An element matcher that returns a fixed result.

Field Summary

Modifier and TypeField and Description
private static final BooleanMatcher<?>
FALSE

A matcher that always returns false.

protected final boolean
matches

The predefined result.

private static final BooleanMatcher<?>
TRUE

A matcher that always returns true.

Constructor Summary

AccessConstructor and Description
public
BooleanMatcher(boolean
The predefined result.
matches
)

Creates a new boolean element matcher.

Method Summary

Modifier and TypeMethod and Description
public boolean
matches(T
The instance to be matched or null.
target
)

Implements net.bytebuddy.matcher.ElementMatcher.matches.

Matches a target against this element matcher.
public static <
The type of the matched entity.
T
>
ElementMatcher.Junction<T>

Returns:

A matcher that returns the provided result for all inputs.
of
(boolean
A matcher that always matches or never matches.
matches
)

Returns an element matcher that returns the provided result.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase:
andor

Field Detail

FALSEback to summary
private static final BooleanMatcher<?> FALSE

A matcher that always returns false.

matchesback to summary
protected final boolean matches

The predefined result.

TRUEback to summary
private static final BooleanMatcher<?> TRUE

A matcher that always returns true.

Constructor Detail

BooleanMatcherback to summary
public BooleanMatcher(boolean matches)

Creates a new boolean element matcher.

Parameters
matches:boolean

The predefined result.

Method Detail

matchesback to summary
public boolean matches(T target)

Implements net.bytebuddy.matcher.ElementMatcher.matches.

Doc from net.bytebuddy.matcher.ElementMatcher.matches.

Matches a target against this element matcher.

Parameters
target:T

The instance to be matched or null.

Returns:boolean

true if the given element is matched by this matcher or false otherwise.

ofback to summary
public static <T> ElementMatcher.Junction<T> of(boolean matches)

Returns an element matcher that returns the provided result.

Parameters
<T>
The type of the matched entity.
matches:boolean

A matcher that always matches or never matches.

Returns:ElementMatcher.Junction<T>

A matcher that returns the provided result for all inputs.

Annotations
@SuppressWarnings:unchecked
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