I have the following Enum:
public enum TipoPokemon {
FIRE("FIRE"),
WATER("WATER"),
GRASS("GRASS"),
ELECTRIC("ELECTRIC"),
ICE("ICE"),
DARK("DARK"),
GHOST("GHOST"),
FAIRY("FAIRY"),
PSYCHIC("PSYCHIC"),
DRAGON("DRAGON"),
POISON("POISON"),
GROUND("GROUND"),
ROCK("ROCK"),
NORMAL("NORMAL"),
BUG("BUG"),
FIGHTING("FIGHTING"),
STEEL("STEEL"),
FLYING("FLYING");
private String nome;
private TipoPokemon(String nome) {
this.nome = nome;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
}
I need to go through each of these values in another class to do a comparison of values. How can I go through each Enum value and compare with a string x?