public class SharedKeyMapPropertyFileData extends Object implements PropertyFileData, Serializable
Some care needs to be taken with the thread safetyness of this class, as the internal SharedKeyMap can be mutated by multiple threads.
| Constructor and Description |
|---|
SharedKeyMapPropertyFileData(Locale locale,
boolean isPrimary,
SharedKeyMap<String,SharedKeyMap<String,Object>> seed,
Set<String> publicSections) |
| Modifier and Type | Method and Description |
|---|---|
void |
compact() |
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)
If this implementation supports sharing of section and parameter names,
then this should allow a non-shared representation to "hop" onto the sharing bandwagon.
|
public SharedKeyMapPropertyFileData(Locale locale, boolean isPrimary, SharedKeyMap<String,SharedKeyMap<String,Object>> seed, Set<String> publicSections)
locale - The locale id should correspond
to a value that came from the g11n.xml fileisPrimary - this is the only label set that can define new sections.seed - this is the shared key map that is shared across multiple locale's versions
of the data.public Locale getLocale()
PropertyFileDatagetLocale in interface PropertyFileDatapublic 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 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 Set<String> getPublicSectionNames()
PropertyFileDatagetPublicSectionNames in interface PropertyFileDatapublic void setSectionAsPublic(String section)
PropertyFileDatasetSectionAsPublic in interface PropertyFileDatasection - the section to mark as "public"public Object put(String sectionName, String paramName, Object value)
PropertyFileDataput in interface PropertyFileDatapublic void compact()
public void removeSection(String sectionName)
PropertyFileDataremoveSection in interface PropertyFileDatapublic Object remove(String sectionName, String paramName)
PropertyFileDataremove in interface PropertyFileDatapublic void shareKeys(SharedKeyMap<String,SharedKeyMap<String,Object>> seedKeyMap)
PropertyFileDataThis is not always supported by implementations. If the implementation doesn't support it, it should be considered a no-op.
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.