Class Configuration

java.lang.Object
cz.cvut.kbss.jopa.utils.Configuration

public final class Configuration extends Object
Contains configuration for the persistence provider and utility access methods for it.

This class is thread safe.

  • Constructor Details

    • Configuration

      public Configuration()
    • Configuration

      public Configuration(Map<String,String> properties)
  • Method Details

    • get

      public String get(String property)
      Gets the configured value of the specified property.
      Parameters:
      property - Property whose value to get
      Returns:
      Configured value, null if property is not configured
    • get

      public String get(String property, String defaultValue)
      Gets the configured value of the specified property.

      The specified default value is returned if the property is not configured.

      Parameters:
      property - Property whose value to get
      defaultValue - Default value to return if no value is configured
      Returns:
      Configured value, defaultValue if property is not configured
    • is

      public boolean is(String property)
      Gets the configured value of the specified boolean-valued property.
      Parameters:
      property - Property whose value to get
      Returns:
      true if the specified property is configured and its value is the boolean true, false otherwise
    • set

      public void set(String property, String value)
      Sets the specified value for the specified property.
      Parameters:
      property - Property whose value to set
      value - Value to set
    • contains

      public boolean contains(String property)
      Checks whether this configuration contains an explicitly set value of the specified property.
      Parameters:
      property - Property whose presence to check
      Returns:
      true if the specified property is configured, false otherwise
    • getProperties

      public Map<String,String> getProperties()
      Gets an unmodifiable view of the underlying map of configuration.
      Returns:
      Unmodifiable Map