Klasse ConfigurationHolder

java.lang.Object
eu.hobbydev.bracheus.classes.ConfigurationHolder
Alle implementierten Schnittstellen:
ConfigurationHolder

public class ConfigurationHolder extends Object implements ConfigurationHolder
Represents a configuration holder that stores user credentials and settings. This class is designed to be serialized/deserialized using Jackson for XML handling. The fields include the username, password, language preference, and API key, which are essential for configuring a user's account and application settings. The class implements the `ConfigurationHolder` interface, ensuring that these fields can be accessed and modified through getter and setter methods. Example use case: - This class can be used to manage user-specific configuration data, such as authentication credentials, language settings, and API keys. It can be loaded from or saved to an XML configuration file for persistence across application sessions.
  • Konstruktordetails

    • ConfigurationHolder

      public ConfigurationHolder()
  • Methodendetails

    • getUsername

      public String getUsername()
      Gets the username stored in this configuration.
      Angegeben von:
      getUsername in Schnittstelle ConfigurationHolder
      Gibt zurück:
      the username
    • getPassword

      public String getPassword()
      Gets the password stored in this configuration.
      Angegeben von:
      getPassword in Schnittstelle ConfigurationHolder
      Gibt zurück:
      the password
    • getLang

      public String getLang()
      Gets the language preference stored in this configuration. The language code can be a standard code such as "EN" for English.
      Angegeben von:
      getLang in Schnittstelle ConfigurationHolder
      Gibt zurück:
      the language code (e.g., "EN")
    • getApiKey

      public String getApiKey()
      Gets the API key stored in this configuration.
      Angegeben von:
      getApiKey in Schnittstelle ConfigurationHolder
      Gibt zurück:
      the API key
    • setUsername

      public void setUsername(String username)
      Sets the username in this configuration.
      Angegeben von:
      setUsername in Schnittstelle ConfigurationHolder
      Parameter:
      username - the username to set
    • setPassword

      public void setPassword(String password)
      Sets the password in this configuration.
      Angegeben von:
      setPassword in Schnittstelle ConfigurationHolder
      Parameter:
      password - the password to set
    • setLang

      public void setLang(String lang)
      Sets the language preference in this configuration.
      Angegeben von:
      setLang in Schnittstelle ConfigurationHolder
      Parameter:
      lang - the language code to set (e.g., "EN")
    • setApiKey

      public void setApiKey(String apiKey)
      Sets the API key in this configuration.
      Angegeben von:
      setApiKey in Schnittstelle ConfigurationHolder
      Parameter:
      apiKey - the API key to set
    • toString

      public String toString()
      Returns a string representation of this configuration. This method masks sensitive information (password and API key) for security purposes.
      Angegeben von:
      toString in Schnittstelle ConfigurationHolder
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      a string containing all configuration fields, with the password and API key masked