Package it.polimi.ingsw.Model.Enums
Enum Class TeamID
- All Implemented Interfaces:
Serializable
,Comparable<TeamID>
,Constable
There are only a handful of possible teams in a game. This enumeration represents them
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionprivate static final long
private final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic TeamID
fromInteger
(int id) Given an integer, find the corresponding teamstatic TeamID
Returns the enum constant of this class with the specified name.static TeamID[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
ONE
-
TWO
-
THREE
-
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
teamID
private final int teamID
-
-
Constructor Details
-
TeamID
private TeamID(int teamID) Internal constructor of the enum- Parameters:
teamID
- the id of the team
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
fromInteger
Given an integer, find the corresponding team- Parameters:
id
- the id of the team to enumerate- Returns:
- the
TeamID
enum variant if the id is between 0 and 3 (excluded), otherwise returns null
-