Predicate < Element > function ( final Set < Modifier > arg0 ) { return new Predicate < Element > ( ) { @ Override public boolean apply ( Element arg1 ) { return arg1 . getModifiers ( ) . containsAll ( arg0 ) ; } } ; }
returns a predicate that can be used to filter elements by modifier . the predicate returns true if the input element has all of the given modifiers , perhaps in addition to others . here is an example how one could get a list of methods with certain modifiers of a class : set modifiers = ... ; fluentiterable.from elementfilter.methodsin clazzelement.getenclosedelements . filter moreelements.hasmodifiers modifiers . tolist ; concode_field_sep ElementVisitor<TypeElement,Void> TYPE_ELEMENT_VISITOR concode_elem_sep ElementVisitor<VariableElement,Void> VARIABLE_ELEMENT_VISITOR concode_elem_sep ElementVisitor<PackageElement,Void> PACKAGE_ELEMENT_VISITOR concode_elem_sep ElementVisitor<ExecutableElement,Void> EXECUTABLE_ELEMENT_VISITOR concode_field_sep PackageElement getPackage concode_elem_sep boolean isAnnotationPresent concode_elem_sep PackageElement asPackage concode_elem_sep ImmutableSet<ExecutableElement> getLocalAndInheritedMethods concode_elem_sep void getLocalAndInheritedMethods concode_elem_sep boolean isType concode_elem_sep TypeElement asType concode_elem_sep TypeElement visitType concode_elem_sep PackageElement defaultAction concode_elem_sep TypeElement defaultAction concode_elem_sep VariableElement defaultAction concode_elem_sep ExecutableElement defaultAction concode_elem_sep Optional<AnnotationMirror> getAnnotationMirror concode_elem_sep VariableElement visitVariable concode_elem_sep boolean methodVisibleFromPackage concode_elem_sep PackageElement visitPackage concode_elem_sep VariableElement asVariable concode_elem_sep ExecutableElement asExecutable concode_elem_sep ExecutableElement visitExecutable