# Class DefaultRuntimeProperties

java.lang.Object
org.apache.cayenne.configuration.DefaultRuntimeProperties

All Implemented Interfaces:
  `RuntimeProperties`

public class DefaultRuntimeProperties extends Object implements RuntimeProperties
An implementation of `RuntimeProperties` that returns properties that were injected via a map in constructor. Each property can be overridden via -D command line option (i.e. in this implementation JVM system properties take precedence over any other property configuration mechanism).

Since:
  3.1

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected Map<String,String>`
  `properties`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DefaultRuntimeProperties(Map<String,String> properties)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `get(String key)`
  Returns a String property value for a given key.
  `String`
  `get(String key, String defaultValue)`
  Returns a String property value for a given key or a default value if a value is not present in properties or is null.
  `boolean`
  `getBoolean(String key, boolean defaultValue)`
  `int`
  `getInt(String key, int defaultValue)`
  `long`
  `getLong(String key, long defaultValue)`
  `Map<String,String>`
  `toMap()`
  Returns a snapshot of the properties as a map, with the same key resolution rules as `RuntimeProperties.get(String)`.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### properties

    protected Map<String,String> properties

- ## Constructor Details

  - ### DefaultRuntimeProperties

    public DefaultRuntimeProperties(Map<String,String> properties)

- ## Method Details

  - ### get

    public String get(String key)
    Description copied from interface: `RuntimeProperties`
    Returns a String property value for a given key.
    Specified by:
      `get` in interface `RuntimeProperties`

  - ### get

    public String get(String key, String defaultValue)
    Description copied from interface: `RuntimeProperties`
    Returns a String property value for a given key or a default value if a value is not present in properties or is null.
    Specified by:
      `get` in interface `RuntimeProperties`
    Since:
      4.0

  - ### getLong

    public long getLong(String key, long defaultValue)
    Specified by:
      `getLong` in interface `RuntimeProperties`

  - ### getInt

    public int getInt(String key, int defaultValue)
    Specified by:
      `getInt` in interface `RuntimeProperties`

  - ### getBoolean

    public boolean getBoolean(String key, boolean defaultValue)
    Specified by:
      `getBoolean` in interface `RuntimeProperties`

  - ### toMap

    public Map<String,String> toMap()
    Description copied from interface: `RuntimeProperties`
    Returns a snapshot of the properties as a map, with the same key resolution rules as `RuntimeProperties.get(String)`.
    Specified by:
      `toMap` in interface `RuntimeProperties`