com.slimgears.apt.data.HasMethods Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of apt-utils Show documentation
Show all versions of apt-utils Show documentation
General purpose utils / module: apt-utils
/**
*
*/
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