com.g2forge.alexandria.java.reflect.JavaModifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ax-java Show documentation
Show all versions of ax-java Show documentation
Standard Java library and the basis of the ${alexandria.name} project.
package com.g2forge.alexandria.java.reflect;
import java.lang.reflect.Member;
import java.lang.reflect.Modifier;
import java.util.EnumSet;
import java.util.Set;
import lombok.RequiredArgsConstructor;
@RequiredArgsConstructor
public enum JavaModifier {
Public(Modifier.PUBLIC),
Private(Modifier.PRIVATE),
Protected(Modifier.PROTECTED),
Static(Modifier.STATIC),
Final(Modifier.FINAL),
Synchronized(Modifier.SYNCHRONIZED),
Volatile(Modifier.VOLATILE),
Transient(Modifier.TRANSIENT),
Native(Modifier.NATIVE),
Interface(Modifier.INTERFACE),
Abstract(Modifier.ABSTRACT),
Strict(Modifier.STRICT);
public static Set of(Member member) {
final EnumSet retVal = EnumSet.noneOf(JavaModifier.class);
final int modifiers = member.getModifiers();
for (JavaModifier modifier : values()) {
if ((modifier.modifier & modifiers) != 0) retVal.add(modifier);
}
return retVal;
}
protected final int modifier;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy