Package org.datanucleus.properties
Class PropertyStore
java.lang.Object
org.datanucleus.properties.PropertyStore
- Direct Known Subclasses:
AbstractStoreManager
,BasePropertyStore
,Configuration
Representation of a store of properties.
The properties can be for persistence, or for the datastore, or whatever.
This class provides convenience type accessors to the properties.
Properties are always stored in lowercase.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAccessor for the specified property as a Boolean.boolean
getBooleanProperty
(String name) Accessor for the specified property as a boolean.boolean
getBooleanProperty
(String name, boolean resultIfNotSet) Accessor for the specified property as a boolean.int
getIntProperty
(String name) Accessor for the specified property as an int.getProperty
(String name) Method to get the value of a property from the store.getStringProperty
(String name) Accessor for the specified property as a String.boolean
hasProperty
(String name) Accessor for whether a particular property is defined (but may be null).boolean
hasPropertyNotNull
(String name) Accessor for whether a particular property is defined and has a non-null value.protected void
setPropertyInternal
(String name, Object value) Method to set a property in the store
-
Field Details
-
properties
Map of properties. -
frequentProperties
-
-
Constructor Details
-
PropertyStore
public PropertyStore()
-
-
Method Details
-
setPropertyInternal
Method to set a property in the store- Parameters:
name
- Name of the propertyvalue
- Its value
-
getProperty
Method to get the value of a property from the store.- Parameters:
name
- Name of the property- Returns:
- Its value (or null)
-
hasProperty
Accessor for whether a particular property is defined (but may be null).- Parameters:
name
- Property name- Returns:
- Whether the property is defined
-
hasPropertyNotNull
Accessor for whether a particular property is defined and has a non-null value.- Parameters:
name
- Property name- Returns:
- Whether the property is defined
-
getIntProperty
Accessor for the specified property as an int. If the specified property isn't found returns 0.- Parameters:
name
- Name of the property- Returns:
- Int value for the property
- Throws:
PropertyTypeInvalidException
- thrown when the property is not available as this type
-
getBooleanProperty
Accessor for the specified property as a boolean. If the specified property isn't found returns false.- Parameters:
name
- Name of the property- Returns:
- Boolean value for the property
- Throws:
PropertyTypeInvalidException
- thrown when the property is not available as this type
-
getBooleanProperty
Accessor for the specified property as a boolean.- Parameters:
name
- Name of the propertyresultIfNotSet
- The value to return if no value for the specified property is found.- Returns:
- Boolean value for the property
- Throws:
PropertyTypeInvalidException
- thrown when the property is not available as this type
-
getBooleanObjectProperty
Accessor for the specified property as a Boolean. If the specified property isn't found returns false.- Parameters:
name
- Name of the property- Returns:
- Boolean value for the property (or null if not present)
- Throws:
PropertyTypeInvalidException
- thrown when the property is not available as this type
-
getStringProperty
Accessor for the specified property as a String. If the specified property isn't found returns null.- Parameters:
name
- Name of the property- Returns:
- String value for the property
- Throws:
PropertyTypeInvalidException
- thrown when the property is not available as this type
-
getFrequentProperties
- Returns:
- properties, which are stored in field for faster access
-