Enum Class Region
- All Implemented Interfaces:
Serializable
,Comparable<Region>
,Constable
Class to provide constants for different regions
- Author:
- Gruppe 6
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Region
findRegion
(String regionTxt) Method to find a region hence on region text in theparam
Getter for the region text associated to the enumprivate static boolean
validRegion
(String region) Method to check if a region is validstatic Region
Returns the enum constant of this class with the specified name.static Region[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SOUTHERN_REGION
-
EASTERN_REGION
-
NORTHERN_REGION
-
WESTERN_REGION
-
SOUTH_WESTERN_REGION
-
INLAND_REGION
-
-
Field Details
-
regionTxt
-
-
Constructor Details
-
Region
this is a constructor for the region class- Parameters:
regionTxt
- the text version of a region
-
-
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
-
getRegionTxt
Getter for the region text associated to the enum- Returns:
- Region text
-
findRegion
Method to find a region hence on region text in theparam
- Parameters:
regionTxt
- Name of region- Returns:
- Region constant if match with parameter text, otherwise null
-
validRegion
Method to check if a region is valid- Parameters:
region
- The region to check- Returns:
true
if the param region matches a registered region, otherwisefalse
-