Class Setting

java.lang.Object
me.hsgamer.hscore.database.Setting

public class Setting extends Object
The setting for connection
  • Method Details

    • create

      public static Setting create(Driver driver)
      Create a new setting with the default values from the driver
      Parameters:
      driver - the driver
      Returns:
      the setting
    • deserialize

      public static Setting deserialize(Driver driver, Map<String,Object> map)
      Deserialize the setting from the map
      Parameters:
      map - the map
      Returns:
      the setting
    • serialize

      public Map<String,Object> serialize()
      Serialize the setting to the map
      Returns:
      the map
    • getDriver

      public Driver getDriver()
      Get the driver
      Returns:
      the driver
    • getHost

      public String getHost()
      Get the host
      Returns:
      the host
    • setHost

      @Contract("_ -> this") public Setting setHost(String host)
      Set the host
      Parameters:
      host - the host
      Returns:
      this for builder chain
    • getDatabaseName

      public String getDatabaseName()
      Get the database name
      Returns:
      the database name
    • setDatabaseName

      @Contract("_ -> this") public Setting setDatabaseName(String databaseName)
      Set the database name
      Parameters:
      databaseName - the database name
      Returns:
      this for builder chain
    • getPort

      public String getPort()
      Get the port
      Returns:
      the port
    • setPort

      @Contract("_ -> this") public Setting setPort(String port)
      Set the port
      Parameters:
      port - the port
      Returns:
      this for builder chain
    • getUsername

      public String getUsername()
      Get the username
      Returns:
      the username
    • setUsername

      @Contract("_ -> this") public Setting setUsername(String username)
      Set the username
      Parameters:
      username - the username
      Returns:
      this for builder chain
    • getPassword

      public String getPassword()
      Get the password
      Returns:
      the password
    • setPassword

      @Contract("_ -> this") public Setting setPassword(String password)
      Set the password
      Parameters:
      password - the password
      Returns:
      this for builder chain
    • setClientProperty

      @Contract("_, _ -> this") public Setting setClientProperty(String property, Object value)
      Set the client property
      Parameters:
      property - the property
      value - the value
    • getClientProperties

      public Map<String,Object> getClientProperties()
      Get all client properties
      Returns:
      the properties
    • setClientProperties

      @Contract("_ -> this") public Setting setClientProperties(Map<String,Object> properties)
      Set the client properties
      Parameters:
      properties - the properties
    • getClientPropertyStrings

      public List<String> getClientPropertyStrings()
      Get all driver properties as a list of string
      Returns:
      the properties as a list of string
    • setDriverProperty

      @Contract("_, _ -> this") public Setting setDriverProperty(String property, Object value)
      Set the driver property
      Parameters:
      property - the property
      value - the value
    • getDriverProperties

      public Map<String,Object> getDriverProperties()
      Get all driver properties
      Returns:
      the properties
    • setDriverProperties

      @Contract("_ -> this") public Setting setDriverProperties(Map<String,Object> properties)
      Set the driver properties
      Parameters:
      properties - the properties
    • getDriverPropertyStrings

      public List<String> getDriverPropertyStrings()
      Get all driver properties as a list of string
      Returns:
      the properties as a list of string
    • getNormalizedHost

      public String getNormalizedHost()
      Get the host and port as a base url
      Returns:
      the base url