package com.jme3.input;

/**
 * Response for joystick callback events.
 * @author jayfella
 */
public enum JoystickState {

    // a list of connected/disconnected codes from various contexts.

    // using the JoystickState.fromCode(int) method, if the code matches
    // it will return the enum value.

    CONNECTED(new int[] {
            0x40001 // GLFW.GLFW_CONNECTED / LWJGL3
    }),

    DISCONNECTED(new int[] {
            0x40002 // GLFW.GLFW_DISCONNECTED / LWJGL3
    }),

    UNKNOWN(new int[0]);

    private int[] codes;

    JoystickState(int[] codes) {
        this.codes = codes;
    }

    private int[] getCodes() {
        return codes;
    }

    public static JoystickState fromCode(int value) {

        for (JoystickState state : values()) {
            for (int code : state.getCodes()) {
                if (value == code) {
                    return state;
                }
            }
        }

        return UNKNOWN;
    }

}

@@ -125,839 +125,36 @@
     
-// a list of connected/disconnected codes from various contexts.%0A%0A    // using the JoystickState.fromCode(int) method, if the code matches%0A    // it will return the enum value.%0A%0A    CONNECTED(new int%5B%5D %7B%0A            0x40001 // GLFW.GLFW_CONNECTED / LWJGL3%0A    %7D),%0A%0A    DISCONNECTED(new int%5B%5D %7B%0A            0x40002 // GLFW.GLFW_DISCONNECTED / LWJGL3%0A    %7D),%0A%0A    UNKNOWN(new int%5B0%5D);%0A%0A    private int%5B%5D codes;%0A%0A    JoystickState(int%5B%5D codes) %7B%0A        this.codes = codes;%0A    %7D%0A%0A    private int%5B%5D getCodes() %7B%0A        return codes;%0A    %7D%0A%0A    public static JoystickState fromCode(int value) %7B%0A%0A        for (JoystickState state : values()) %7B%0A            for (int code : state.getCodes()) %7B%0A                if (value == code) %7B%0A                    return state;%0A                %7D%0A            %7D%0A        %7D%0A%0A        return UNKNOWN;%0A    %7D
+Connected,%0A    Disconnected,
 %0A%0A%7D%0A

Remove magic number translations and remove uppercase names.