سؤال

Is it possible to let a enum in java take a set of enums as as argument? If yes, then how do I implement it?

When using this I whant to be able to say something like: Take a MODAL_SETTINGS.EDIT_MODAL_WINDOW and create this with the buttons MODAL_BUTTONS.SAVE & MODAL_BUTTONS.CANCEL.

This is what I have as of now

public enum MODAL_SETTINGS {
    NEW_MODAL_WINDOW(MODAL_BUTTONS.class),
    EDIT_MODAL_WINDOW(MODAL_BUTTONS.class),
    DELETE_MODAL_WINDOW(MODAL_BUTTONS.class);

    private EnumSet buttons;

    private MODAL_SETTINGS(EnumSet<MODAL_BUTTONS> buttons){

    }

}
public enum MODAL_BUTTONS {
    SAVE, UPDATE, CANCEL, DELETE
}

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top