mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 04:58:57 +00:00
Add enum name lookup method to Java/C# enums
Tested: on Linux for Java and C# Bug: 15781151 Change-Id: I7cb97bcc01d986cac2b24aaf7cb29521ddaa2f6b
This commit is contained in:
4
tests/MyGame/Example/Color.java
Executable file → Normal file
4
tests/MyGame/Example/Color.java
Executable file → Normal file
@@ -6,5 +6,9 @@ public class Color {
|
||||
public static final byte Red = 1;
|
||||
public static final byte Green = 2;
|
||||
public static final byte Blue = 8;
|
||||
|
||||
private static final String[] names = { "Red", "Green", "", "", "", "", "", "Blue", };
|
||||
|
||||
public static String name(int e) { return names[e - Red]; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user