/** It works as a converter, from integer to Type. */ public static Type fromInteger(int id) { for (Type type : Type.values()) { if (type.getValue() == id) { return type; } } return null; }
/** * Given a type, this verifies whether they match. * * @param type Type to compare with. * @return Boolean. */ public boolean isEquals(Type type) { return this.getValue() == type.getValue(); }