How do I get the enum object with an ID that I passed as a parameter to check an element of the enum object if true?
My builder:
private WeaponInterface(int[] weaponId, int speed,
FightType[] fightType) {
this.setWeaponIds(weaponId);
this.speed = speed;
this.fightType = fightType;
}
What I'm trying to do:
public static WeaponInterface forId(Item item){
return Arrays.asList(WeaponInterface.values()).stream().
filter(i -> i.getWeaponIds() == item.getId()).collect(n faço idéia);
}