I'm using Java EE 8 and I have next enum. The question is is it possible assign to the one injected variable the value of another injected variable within one class like on the next line?
public enum CommandEnum {
EMPTY_COMMAND {
{
this.command = emptyCommand;
}
},
NAME_GENERATION {
{
this.command = nameGenerationCommand;
}
},
NAME_GENERATION_SETTINGS {
{
this.command = nameGenerationSettingsCommand;
}
},
SIGNIN {
{
this.command = signinCommand; // is it possible?
}
};
@Inject
@EmptyCommandQualifier
Command command;
@Inject
EmptyCommand emptyCommand;
@Inject
NameGenerationCommand nameGenerationCommand;
@Inject
NameGenerationSettingsCommand nameGenerationSettingsCommand;
@Inject
SigninCommand signinCommand;
public Command getCommand() {
return command;
}
}
Thank you.