All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.atlassian.util.adapter.javax.el.JavaXMethodInfoAdapter Maven / Gradle / Ivy

Go to download

A collection of classes for adapting Servlet API 4.0 objects to Servlet API 5.0 and vice versa.

There is a newer version: 0.1.0
Show newest version
package io.atlassian.util.adapter.javax.el;

import io.atlassian.util.adapter.jakarta.el.JakartaMethodInfoAdapter;

import javax.el.MethodInfo;

import static io.atlassian.util.adapter.util.WrapperUtil.applyIfNonNull;

public class JavaXMethodInfoAdapter extends MethodInfo {

    private final jakarta.el.MethodInfo delegate;

    public static MethodInfo from(jakarta.el.MethodInfo delegate) {
        if (delegate instanceof JakartaMethodInfoAdapter castDelegate) {
            return castDelegate.getDelegate();
        }
        return applyIfNonNull(delegate, JavaXMethodInfoAdapter::new);
    }

    JavaXMethodInfoAdapter(jakarta.el.MethodInfo delegate) {
        super(delegate.getName(), delegate.getReturnType(), delegate.getParamTypes());
        this.delegate = delegate;
    }

    public jakarta.el.MethodInfo getDelegate() {
        return delegate;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy