Class LoggingFailSafeMatcher<T>

java.lang.Object
net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<T>
io.opentelemetry.javaagent.tooling.bytebuddy.LoggingFailSafeMatcher<T>
Type Parameters:
T - The type of the matched entity.
All Implemented Interfaces:
io.opentelemetry.javaagent.extension.matcher.internal.DelegatingMatcher, net.bytebuddy.matcher.ElementMatcher<T>, net.bytebuddy.matcher.ElementMatcher.Junction<T>

public class LoggingFailSafeMatcher<T> extends net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<T> implements io.opentelemetry.javaagent.extension.matcher.internal.DelegatingMatcher
A fail-safe matcher catches exceptions that are thrown by a delegate matcher and returns false.

Logs exception if it was thrown.

See Also:
  • FailSafeMatcher
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher

    net.bytebuddy.matcher.ElementMatcher.Junction<S extends Object>

    Nested classes/interfaces inherited from interface net.bytebuddy.matcher.ElementMatcher.Junction

    net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase<V extends Object>, net.bytebuddy.matcher.ElementMatcher.Junction.Conjunction<W extends Object>, net.bytebuddy.matcher.ElementMatcher.Junction.Disjunction<W extends Object>, net.bytebuddy.matcher.ElementMatcher.Junction.ForNonNullValues<W extends Object>
  • Constructor Summary

    Constructors
    Constructor
    Description
    LoggingFailSafeMatcher(net.bytebuddy.matcher.ElementMatcher<? super T> matcher, String description)
    Creates a new fail-safe element matcher.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    net.bytebuddy.matcher.ElementMatcher<?>
     
    int
     
    boolean
    matches(T target)
     
     

    Methods inherited from class net.bytebuddy.matcher.ElementMatcher.Junction.AbstractBase

    and, or

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • LoggingFailSafeMatcher

      public LoggingFailSafeMatcher(net.bytebuddy.matcher.ElementMatcher<? super T> matcher, String description)
      Creates a new fail-safe element matcher.
      Parameters:
      matcher - The delegate matcher that might throw an exception.
      description - Descriptive string to log along with exception.
  • Method Details

    • matches

      public boolean matches(T target)
      Specified by:
      matches in interface net.bytebuddy.matcher.ElementMatcher<T>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getDelegate

      public net.bytebuddy.matcher.ElementMatcher<?> getDelegate()
      Specified by:
      getDelegate in interface io.opentelemetry.javaagent.extension.matcher.internal.DelegatingMatcher