Package net.bytebuddy.matcher
Class NullMatcher<T>
- java.lang.Object
-
- net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<T>
-
- net.bytebuddy.matcher.NullMatcher<T>
-
- Type Parameters:
T- The type of the matched entity.
- All Implemented Interfaces:
ElementMatcher<T>,ElementMatcher.Junction<T>
@Enhance public class NullMatcher<T> extends ElementMatcher.Junction.AbstractBase<T>
An element matcher that matches thenullvalue.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher.Junction
ElementMatcher.Junction.AbstractBase<V>, ElementMatcher.Junction.Conjunction<W>, ElementMatcher.Junction.Disjunction<W>, ElementMatcher.Junction.ForNonNullValues<W>
-
-
Field Summary
Fields Modifier and Type Field Description private static NullMatcher<?>INSTANCEAn instance of this matcher.
-
Constructor Summary
Constructors Constructor Description NullMatcher()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ElementMatcher.Junction<T>make()Returns a matcher that only matchesnull.booleanmatches(T target)Matches a target against this element matcher.java.lang.StringtoString()-
Methods inherited from class net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase
and, or
-
-
-
-
Field Detail
-
INSTANCE
private static final NullMatcher<?> INSTANCE
An instance of this matcher.
-
-
Method Detail
-
make
public static <T> ElementMatcher.Junction<T> make()
Returns a matcher that only matchesnull.- Type Parameters:
T- The type of the matched entity.- Returns:
- A matcher that only matches
null.
-
matches
public boolean matches(@MaybeNull T target)
Matches a target against this element matcher.- Parameters:
target- The instance to be matched ornull.- Returns:
trueif the given element is matched by this matcher orfalseotherwise.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-