org.bukkit.entity
Enum Villager.Profession

java.lang.Object
  extended by java.lang.Enum<Villager.Profession>
      extended by org.bukkit.entity.Villager.Profession
All Implemented Interfaces:
Serializable, Comparable<Villager.Profession>
Enclosing interface:
Villager

public static enum Villager.Profession
extends Enum<Villager.Profession>

Represents the various different Villager professions there may be.


Enum Constant Summary
BLACKSMITH
           
BUTCHER
           
FARMER
           
LIBRARIAN
           
PRIEST
           
 
Method Summary
 int getId()
          Gets the ID of this profession.
static Villager.Profession getProfession(int id)
          Gets a profession by its ID.
static Villager.Profession valueOf(String name)
          Returns the enum constant of this type with the specified name.
static Villager.Profession[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

FARMER

public static final Villager.Profession FARMER

LIBRARIAN

public static final Villager.Profession LIBRARIAN

PRIEST

public static final Villager.Profession PRIEST

BLACKSMITH

public static final Villager.Profession BLACKSMITH

BUTCHER

public static final Villager.Profession BUTCHER
Method Detail

values

public static final Villager.Profession[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(Villager.Profession c : Villager.Profession.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static Villager.Profession 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

getId

public int getId()
Gets the ID of this profession.

Returns:
Profession ID.

getProfession

public static Villager.Profession getProfession(int id)
Gets a profession by its ID.

Parameters:
id - ID of the profession to get.
Returns:
Resulting profession, or null if not found.


Copyright © 2013. All Rights Reserved.