-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Maxim Butov
committed
Oct 6, 2019
1 parent
b0fd7d7
commit 5aa77b7
Showing
5 changed files
with
102 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
sugar-cubes-library/src/main/java/org/sugarcubes/reflection/XModifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package org.sugarcubes.reflection; | ||
|
||
import java.util.Collections; | ||
import java.util.EnumSet; | ||
import java.util.Set; | ||
|
||
/** | ||
* @author Maxim Butov | ||
*/ | ||
public enum XModifier { | ||
|
||
PUBLIC(0x00000001), | ||
PRIVATE(0x00000002), | ||
PROTECTED(0x00000004), | ||
STATIC(0x00000008), | ||
FINAL(0x00000010), | ||
SYNCHRONIZED(0x00000020), | ||
VOLATILE(0x00000040), | ||
TRANSIENT(0x00000080), | ||
NATIVE(0x00000100), | ||
INTERFACE(0x00000200), | ||
ABSTRACT(0x00000400), | ||
STRICT(0x00000800), | ||
|
||
BRIDGE(0x00000040), | ||
VARARGS(0x00000080), | ||
SYNTHETIC(0x00001000), | ||
ANNOTATION(0x00002000), | ||
ENUM(0x00004000), | ||
MANDATED(0x00008000), | ||
|
||
; | ||
|
||
private static Set<XModifier> set(XModifier first, XModifier... rest) { | ||
return Collections.unmodifiableSet(EnumSet.of(first, rest)); | ||
} | ||
|
||
public static final Set<XModifier> CLASS_MODIFIERS = set(PUBLIC, PROTECTED, PRIVATE, ABSTRACT, STATIC, FINAL, STRICT); | ||
public static final Set<XModifier> INTERFACE_MODIFIERS = set(PUBLIC, PROTECTED, PRIVATE, ABSTRACT, STATIC, STRICT); | ||
public static final Set<XModifier> CONSTRUCTOR_MODIFIERS = set(PUBLIC, PROTECTED, PRIVATE); | ||
public static final Set<XModifier> METHOD_MODIFIERS = set(PUBLIC, PROTECTED, PRIVATE, ABSTRACT, STATIC, FINAL, SYNCHRONIZED, | ||
NATIVE, STRICT); | ||
public static final Set<XModifier> FIELD_MODIFIERS = set(PUBLIC, PROTECTED, PRIVATE, STATIC, FINAL, TRANSIENT, VOLATILE); | ||
public static final Set<XModifier> PARAMETER_MODIFIERS = set(FINAL); | ||
public static final Set<XModifier> ACCESS_MODIFIERS = set(PUBLIC, PROTECTED, PRIVATE); | ||
|
||
private final int intValue; | ||
|
||
XModifier(int intValue) { | ||
this.intValue = intValue; | ||
} | ||
|
||
public int getIntValue() { | ||
return intValue; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters