Module io.ebean.api

Class PropertiesWrapper

java.lang.Object
io.ebean.config.PropertiesWrapper

public class PropertiesWrapper extends Object
  • Field Details

    • properties

      protected final Properties properties
    • prefix

      protected final String prefix
    • serverName

      protected final String serverName
  • Constructor Details

    • PropertiesWrapper

      public PropertiesWrapper(String prefix, String serverName, Properties properties, ClassLoadConfig classLoadConfig)
      Construct with a prefix, serverName and properties.
    • PropertiesWrapper

      public PropertiesWrapper(Properties properties, ClassLoadConfig classLoadConfig)
      Construct without prefix of serverName.
  • Method Details

    • getServerName

      public String getServerName()
      Return the serverName (optional).
    • get

      public String get(String key)
      Get a property with no default value.
    • get

      public String get(String key, String defaultValue)
      Get a property with a default value.

      This performs a search using the prefix and server name (if supplied) to search for the property value in order based on:

      
         prefix.serverName.key
         prefix.key
         key
       

    • getDouble

      public double getDouble(String key, double defaultValue)
      Return a double property value.
    • getInt

      public int getInt(String key, int defaultValue)
      Return an int property value.
    • getLong

      public long getLong(String key, long defaultValue)
      Return a long property value.
    • getBoolean

      public boolean getBoolean(String key, boolean defaultValue)
      Return a boolean property value.
    • getEnum

      public <T extends Enum<T>> T getEnum(Class<T> enumType, String key, T defaultValue)
      Return a Enum property value.
    • createInstance

      public <T> T createInstance(Class<T> pluginType, String key, T instance)
      Return the instance to use (can be null) for the given plugin.
      Parameters:
      pluginType - the type of plugin
      key - properties key
      instance - existing instance
    • createInstance

      public <T> T createInstance(Class<T> pluginType, String classname)
      Return the instance to use (can be null) for the given plugin.
      Parameters:
      pluginType - the type of plugin
      classname - the implementation class as per properties