java.lang.Object
java.lang.Enum<Region>
edu.ntnu.idatt1002.g106.handballapp.finalprod.backend.Region
All Implemented Interfaces:
Serializable, Comparable<Region>, Constable

public enum Region extends Enum<Region>
Class to provide constants for different regions
Author:
Gruppe 6
  • Enum Constant Details

    • SOUTHERN_REGION

      public static final Region SOUTHERN_REGION
    • EASTERN_REGION

      public static final Region EASTERN_REGION
    • NORTHERN_REGION

      public static final Region NORTHERN_REGION
    • WESTERN_REGION

      public static final Region WESTERN_REGION
    • SOUTH_WESTERN_REGION

      public static final Region SOUTH_WESTERN_REGION
    • INLAND_REGION

      public static final Region INLAND_REGION
  • Field Details

    • regionTxt

      private String regionTxt
  • Constructor Details

    • Region

      private Region(String regionTxt)
      this is a constructor for the region class
      Parameters:
      regionTxt - the text version of a region
  • Method Details

    • values

      public static Region[] 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

      public static Region valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getRegionTxt

      public String getRegionTxt()
      Getter for the region text associated to the enum
      Returns:
      Region text
    • findRegion

      public static Region findRegion(String regionTxt)
      Method to find a region hence on region text in the param
      Parameters:
      regionTxt - Name of region
      Returns:
      Region constant if match with parameter text, otherwise null
    • validRegion

      private static boolean validRegion(String region)
      Method to check if a region is valid
      Parameters:
      region - The region to check
      Returns:
      true if the param region matches a registered region, otherwise false