/home/caleb/ASDV-WebDev/Semester 2/Assignments/lab1-CalebFontenot/src/main/java/edu/slcc/asdv/LanguageBean.java |
nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt
nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java
package edu.slcc.asdv;
import jakarta.inject.Named;
import jakarta.enterprise.context.RequestScoped;
@author
@Named(value = "languageBean")
@RequestScoped
public class LanguageBean {
private String language;
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language.trim();
}
public String showChoice() {
if (language.equalsIgnoreCase("Java") || language.equalsIgnoreCase("Groovy")) {
return ("goodLanguage");
} else if (isMissing(language)) {
return ("MissingLanguage");
} else {
return ("badLanguage");
}
}
private boolean isMissing(String value) {
return ((value == null) || (value.trim().isEmpty()));
}
}