Class Config


  • public class Config
    extends java.lang.Object
    A config that is created by parsing and validating XML config files according to the Breitband requirements.
    Author:
    Luna Otte
    • Constructor Summary

      Constructors 
      Constructor Description
      Config​(java.io.Reader r)
      Creates a new config by reading and validating a config file.
    • Constructor Detail

      • Config

        public Config​(java.io.Reader r)
               throws javax.xml.stream.XMLStreamException,
                      ConfigReaderException
        Creates a new config by reading and validating a config file. After instantiation, use the various getters to get the information that was parsed.
        Parameters:
        r - A reader to the XML file
        Throws:
        javax.xml.stream.XMLStreamException - If an error occurs while parsing
        ConfigReaderException
    • Method Detail

      • getVersion

        public static java.lang.String getVersion()
        Gets the configured config version
        Returns:
        The config version
      • getCountryName

        public java.lang.String getCountryName()
        Gets the configured country name
        Returns:
        The country name
      • getCountryCode

        public java.lang.String getCountryCode()
        Gets the configured country code
        Returns:
        The country code
      • getDescription

        public java.lang.String getDescription()
        Gets the configured description
        Returns:
        The description
      • getMapCredits

        public MapCredits getMapCredits()
        Gets the configured map credits
        Returns:
        The map credits
      • getContractPool

        public ContractPool getContractPool()
        Returns a HashMap with all contracts that were found in the config file
        Returns:
        All contracts
      • getRegions

        public Region[] getRegions()
        Returns a Vector with all regions that were found in the config file
        Returns:
        All regions
      • getCableConfigs

        public CableConfig[] getCableConfigs()
        Returns all cables that were found in the config file
        Returns:
        All cables
      • toString

        public java.lang.String toString()
        Returns a string representation of the config, for debugging purposes.
        Overrides:
        toString in class java.lang.Object
        Returns:
        The string representation