Enum FarmerPerm

java.lang.Object
java.lang.Enum<FarmerPerm>
xyz.geik.farmer.model.user.FarmerPerm
All Implemented Interfaces:
Serializable, Comparable<FarmerPerm>, java.lang.constant.Constable

public enum FarmerPerm extends Enum<FarmerPerm>
Enum class of farmer permission of user
  • Enum Constant Details

    • COOP

      public static final FarmerPerm COOP
      COOP perm of farmer
    • MEMBER

      public static final FarmerPerm MEMBER
      MEMBER perm of player
    • OWNER

      public static final FarmerPerm OWNER
      OWNER perm of farmer
  • Method Details

    • values

      public static FarmerPerm[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static FarmerPerm valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • getName

      public String getName()
      Gets name of role
      Returns:
      name of role
    • getRole

      public static FarmerPerm getRole(int id)
      Gets role of farmer by int id
      Parameters:
      id - of role
      Returns:
      FarmerPerm object
    • getRoleByName

      public static FarmerPerm getRoleByName(String name)
      Gets role by string
      Parameters:
      name - of role
      Returns:
      FarmerPerm object
    • getRoleId

      @Contract(pure=true) public static int getRoleId(@NotNull @NotNull FarmerPerm perm)
      Gets int id of role
      Parameters:
      perm - of farmer
      Returns:
      int of FarmerPerm object