Class ElementMatcher.Junction.AbstractBase<V>

java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<V>
Type Parameters:
V - The type of the object that is being matched.
All Implemented Interfaces:
ElementMatcher<V>, ElementMatcher.Junction<V>
Direct Known Subclasses:
BooleanMatcher, CachingMatcher, ClassLoaderHierarchyMatcher, ClassLoaderParentMatcher, ElementMatcher.Junction.Conjunction, ElementMatcher.Junction.Disjunction, ElementMatcher.Junction.ForNonNullValues, EqualityMatcher, FailSafeMatcher, NegatingMatcher, NullMatcher
Enclosing interface:
ElementMatcher.Junction<S>

public abstract static class ElementMatcher.Junction.AbstractBase<V> extends Object implements ElementMatcher.Junction<V>
A base implementation of ElementMatcher.Junction.
  • Constructor Details

    • AbstractBase

      public AbstractBase()
  • Method Details

    • and

      public <U extends V> ElementMatcher.Junction<U> and(ElementMatcher<? super U> other)
      Creates a conjunction where this matcher and the other matcher must both be matched in order to constitute a successful match. The other matcher is only invoked if this matcher constitutes a successful match.
      Specified by:
      and in interface ElementMatcher.Junction<V>
      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 the other matcher 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

      public <U extends V> ElementMatcher.Junction<U> or(ElementMatcher<? super U> other)
      Creates a disjunction where either this matcher or the other matcher must be matched in order to constitute a successful match. The other matcher is only invoked if this matcher constitutes an unsuccessful match.
      Specified by:
      or in interface ElementMatcher.Junction<V>
      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 the other matcher 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.