public class MapPropertyFileData extends Object implements PropertyFileData, Serializable
PropertyFileData
that is a HashMap of section name to HashMaps of parameter name to values.
If there is overlap between the section or parameter keys with, say another
language's version, you should consider using the SharedKeyMapPropertyFileData
implementation.
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Map<String,Object>> |
data |
protected Locale |
locale |
protected Set<String> |
publicSections |
| Constructor and Description |
|---|
MapPropertyFileData()
Use this constructor if you are uninterested in locale specific data.
|
MapPropertyFileData(Locale locale) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String sectionName,
String paramName) |
boolean |
containsSection(String sectionName) |
Set<Map.Entry<String,Map<String,Object>>> |
entrySet() |
Locale |
getLocale()
Gets the locale associated with this data if any
|
Set<String> |
getPublicSectionNames()
Returns an unmodifiable map of section names that are "namespaced"
in that they are publicly accessible and versioned.
|
Map<String,Object> |
getSection(String sectionName)
Returns an unmodifiable map of all the values for a particular sectionName.
|
Set<String> |
getSectionNames()
Returns an unmodifiable set of section names in the data.
|
Object |
put(String sectionName,
String paramName,
Object value)
Adds a value to the data.
|
Object |
remove(String sectionName,
String paramName)
Removes the value for a section/parameter key,
|
void |
removeSection(String sectionName)
Removes all properties for the given section name.
|
void |
setSectionAsPublic(String section)
The set of "public" sections.
|
void |
shareKeys(SharedKeyMap<String,SharedKeyMap<String,Object>> seedKeyMap)
No-op.
|
protected final Locale locale
public MapPropertyFileData()
getLocale() will throw an exception if called.public MapPropertyFileData(Locale locale)
locale - the locale of this property file data
Only use this constructor if you are dealing with
data that is specific to a locale. The locale id should correspond
to a value that came from the global.locale table.public Locale getLocale()
PropertyFileDatagetLocale in interface PropertyFileDataIllegalStateException - if this is called when constructed without a localeId specified.public Map<String,Object> getSection(String sectionName)
PropertyFileDatanull.getSection in interface PropertyFileDatapublic Set<Map.Entry<String,Map<String,Object>>> entrySet()
entrySet in interface PropertyFileDatapublic Set<String> getSectionNames()
PropertyFileDatagetSectionNames in interface PropertyFileDatapublic Set<String> getPublicSectionNames()
PropertyFileDatagetPublicSectionNames in interface PropertyFileDatapublic void removeSection(String sectionName)
PropertyFileDataremoveSection in interface PropertyFileDatapublic Object remove(String sectionName, String paramName)
PropertyFileDataremove in interface PropertyFileDatapublic boolean containsSection(String sectionName)
containsSection in interface PropertyFileDataPropertyFileData.contains(String, String)public boolean contains(String sectionName, String paramName)
contains in interface PropertyFileDataPropertyFileData.containsSection(String)public Object put(String sectionName, String paramName, Object value)
PropertyFileDataput in interface PropertyFileDatapublic void setSectionAsPublic(String section)
PropertyFileDatasetSectionAsPublic in interface PropertyFileDatasection - the section to mark as "public"public void shareKeys(SharedKeyMap<String,SharedKeyMap<String,Object>> seedKeyMap)
shareKeys in interface PropertyFileDataSharedKeyMapPropertyFileDataCopyright (c) 2016-2017, Salesforce.com, Inc. All rights reserved. Licensed under the BSD 3-Clause license. For full license text, see the LICENSE.txt file in the repository.