Class InstrumentationProxyHelper

java.lang.Object
io.opentelemetry.javaagent.bootstrap.InstrumentationProxyHelper

public class InstrumentationProxyHelper extends Object
  • Method Details

    • unwrapIfNeeded

      public static <T> T unwrapIfNeeded(Object o, Class<T> type)
      Unwraps and casts an indy proxy, or just casts if it's not an indy proxy.
      Type Parameters:
      T - type of object to return
      Parameters:
      o - object to unwrap
      type - expected object type
      Returns:
      unwrapped proxy instance or the original object (if not a proxy) cast to the expected type
      Throws:
      IllegalArgumentException - if the provided object the proxied object can't be cast to the expected type