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

com.slimgears.apt.data.HasMethods Maven / Gradle / Ivy

There is a newer version: 0.7.58
Show newest version
/**
 *
 */
package com.slimgears.apt.data;

import com.google.common.collect.ImmutableList;

import javax.lang.model.element.ExecutableElement;

public interface HasMethods {
    ImmutableList methods();

    default ImmutableList constructors() {
        return methods()
                .stream()
                .filter(m -> "".equals(m.name()))
                .collect(ImmutableList.toImmutableList());
    }

    @SuppressWarnings("unchecked")
    interface Builder> {
        ImmutableList.Builder methodsBuilder();

        default B method(ExecutableElement element) {
            return method(MethodInfo.of(element));
        }

        default B method(MethodInfo method) {
            methodsBuilder().add(method);
            return (B)this;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy