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

org.jtwig.reflection.model.java.JavaMethods Maven / Gradle / Ivy

There is a newer version: 5.87.0.RELEASE
Show newest version
package org.jtwig.reflection.model.java;

import com.google.common.base.Optional;

import java.util.Collection;
import java.util.Map;

public class JavaMethods {
    private final Map methods;

    public JavaMethods(Map methods) {
        this.methods = methods;
    }

    public Collection getMethods() {
        return methods.values();
    }

    public Optional getMethod(Class... types) {
        return Optional.fromNullable(methods.get(MethodSignature.create(types)));
    }

    public void merge(JavaMethods origin) {
        for (Map.Entry entry : origin.methods.entrySet()) {
            if (!methods.containsKey(entry.getKey())) {
                methods.put(entry.getKey(), entry.getValue());
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy