Package net.bytebuddy.matcher
Interface ElementMatcher.Junction<S>
-
- Type Parameters:
S- The type of the object that is being matched.
- All Superinterfaces:
ElementMatcher<S>
- All Known Implementing Classes:
AccessibilityMatcher,AnnotationTargetMatcher,AnnotationTypeMatcher,ArrayTypeMatcher,BooleanMatcher,ByteBuddyMojo.FilePrefixMatcher,ByteBuddyMojo.StalenessFilter,CachingMatcher,CachingMatcher.WithInlineEviction,ClassFileVersionMatcher,ClassLoaderHierarchyMatcher,ClassLoaderParentMatcher,CollectionElementMatcher,CollectionErasureMatcher,CollectionItemMatcher,CollectionOneToOneMatcher,CollectionSizeMatcher,DeclaringAnnotationMatcher,DeclaringFieldMatcher,DeclaringMethodMatcher,DeclaringTypeMatcher,DefinedShapeMatcher,DescriptorMatcher,ElementMatcher.Junction.AbstractBase,ElementMatcher.Junction.Conjunction,ElementMatcher.Junction.Disjunction,ElementMatcher.Junction.ForNonNullValues,EqualityMatcher,ErasureMatcher,FailSafeMatcher,FieldTypeMatcher,HashCodeAndEqualsPlugin.ValueMatcher,HasSuperClassMatcher,HasSuperTypeMatcher,InheritedAnnotationMatcher,InstanceTypeMatcher,IsNamedMatcher,LatentMatcher.ForFieldToken.ResolvedMatcher,LatentMatcher.ForMethodToken.ResolvedMatcher,MethodExceptionTypeMatcher,MethodOverrideMatcher,MethodParametersMatcher,MethodParameterTypeMatcher,MethodParameterTypesMatcher,MethodReturnTypeMatcher,MethodSortMatcher,ModifierMatcher,NameMatcher,NegatingMatcher,NullMatcher,PrimitiveTypeMatcher,RecordMatcher,SignatureTokenMatcher,StringMatcher,StringSetMatcher,SubTypeMatcher,SuperTypeMatcher,TypeSortMatcher,VisibilityMatcher
- Enclosing interface:
- ElementMatcher<T>
public static interface ElementMatcher.Junction<S> extends ElementMatcher<S>
A junctions allows to chain differentElementMatchers in a readable manner.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classElementMatcher.Junction.AbstractBase<V>A base implementation ofElementMatcher.Junction.static classElementMatcher.Junction.Conjunction<W>A conjunction matcher which only matches an element if both represented matchers constitute a match.static classElementMatcher.Junction.Disjunction<W>A disjunction matcher which matches an element against matchers in order to constitute a successful match.static classElementMatcher.Junction.ForNonNullValues<W>An abstract base implementation that rejects null values.-
Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher
ElementMatcher.Junction<S>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <U extends S>
ElementMatcher.Junction<U>and(ElementMatcher<? super U> other)Creates a conjunction where this matcher and theothermatcher must both be matched in order to constitute a successful match.<U extends S>
ElementMatcher.Junction<U>or(ElementMatcher<? super U> other)Creates a disjunction where either this matcher or theothermatcher must be matched in order to constitute a successful match.-
Methods inherited from interface net.bytebuddy.matcher.ElementMatcher
matches
-
-
-
-
Method Detail
-
and
<U extends S> ElementMatcher.Junction<U> and(ElementMatcher<? super U> other)
Creates a conjunction where this matcher and theothermatcher must both be matched in order to constitute a successful match. The other matcher is only invoked if this matcher constitutes a successful match.- Type Parameters:
U- The type of the object that is being matched. Note that Java's type inference might not be able to infer the common subtype of this instance and theothermatcher such that this type must need to be named explicitly.- Parameters:
other- The second matcher to consult.- Returns:
- A conjunction of this matcher and the other matcher.
-
or
<U extends S> ElementMatcher.Junction<U> or(ElementMatcher<? super U> other)
Creates a disjunction where either this matcher or theothermatcher must be matched in order to constitute a successful match. The other matcher is only invoked if this matcher constitutes an unsuccessful match.- Type Parameters:
U- The type of the object that is being matched. Note that Java's type inference might not be able to infer the common subtype of this instance and theothermatcher such that this type must need to be named explicitly.- Parameters:
other- The second matcher to consult.- Returns:
- A disjunction of this matcher and the other matcher.
-
-