コード例 #1
0
ファイル: Sheath.java プロジェクト: Warkdev/JaNGOSWAuth
 /**
  * Method to check whether the given value exists within this enum.
  *
  * @param value The value to be checked.
  * @return True if the value exists.
  */
 public static boolean exists(int value) {
   for (Sheath g : Sheath.values()) {
     if (g.getValue() == value) {
       return true;
     }
   }
   return false;
 }
コード例 #2
0
ファイル: Sheath.java プロジェクト: Warkdev/JaNGOSWAuth
 /**
  * Convert an int value into a Sheath value.
  *
  * @param value
  * @return The Sheath corresponding to that value, null if there is no match.
  */
 public static Sheath convert(int value) {
   for (Sheath v : Sheath.values()) {
     if (v.getValue() == value) {
       return v;
     }
   }
   return null;
 }