public final class SkinnyMapPropertyFileData extends Object implements PropertyFileData
SkinnyMapPropertyFileData's the overhead per
map element stored at both levels is reduced to 8 bytes per entry. Most other Map implementation have higher
per entry overheads. The trade of is the cost of get's will go from O(1) to O(logN). So clients that can afford
slower gets, and have memory conscious requirements, should consider using this over other PropertyFileData
implementations.
Also, instances of SkinnyMapPropertyFileData will only be truly immutable if the concrete
Object in 'data' is immutable (i.e. String).| Constructor and Description |
|---|
SkinnyMapPropertyFileData(MapPropertyFileData m)
Creates a new
SkinnyMapPropertyFileData from existing MapPropertyFileData |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(String sectionName,
String paramName)
returns if a parameter exists (true) or not (false) for the specified section.
|
boolean |
containsSection(String sectionName)
returns if a section exists (true) or not (false) in this property data.
|
Set<Map.Entry<String,Map<String,Object>>> |
entrySet()
Returns the set sections and corresponding parameters/values.
|
Locale |
getLocale()
Get's copy of locale.
|
Set<String> |
getPublicSectionNames()
Returns set of public sections.
|
Map<String,Object> |
getSection(String sectionName)
Returns section, if exists from property file metadata.
|
Set<String> |
getSectionNames()
Returns set of section names.
|
Object |
put(String sectionName,
String paramName,
Object value)
Use of method will always result in
IllegalStateException. |
Object |
remove(String sectionName,
String paramName)
Use of method will always result in
IllegalStateException. |
void |
removeSection(String sectionName)
Use of method will always result in
IllegalStateException. |
void |
setSectionAsPublic(String section)
Use of method will always result in
IllegalStateException. |
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 SkinnyMapPropertyFileData(MapPropertyFileData m)
SkinnyMapPropertyFileData from existing MapPropertyFileDatam - MapPropertyFileData that will be copied into a ImmutableSortedMap.public Map<String,Object> getSection(String sectionName)
getSection in interface PropertyFileDatapublic Set<Map.Entry<String,Map<String,Object>>> entrySet()
entrySet 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 Locale getLocale()
getLocale in interface PropertyFileDatapublic Set<String> getSectionNames()
getSectionNames in interface PropertyFileDatapublic Set<String> getPublicSectionNames()
getPublicSectionNames in interface PropertyFileDatapublic Object put(String sectionName, String paramName, Object value)
IllegalStateException. This is because the data within
SkinnyMapPropertyFileData should not be modified.put in interface PropertyFileDatapublic Object remove(String sectionName, String paramName)
IllegalStateException. This is because the data within
SkinnyMapPropertyFileData should not be modified.remove in interface PropertyFileDatapublic void removeSection(String sectionName)
IllegalStateException. This is because the data within
SkinnyMapPropertyFileData should not be modified.removeSection in interface PropertyFileDatapublic void setSectionAsPublic(String section)
IllegalStateException. This is because the data within
SkinnyMapPropertyFileData should not be modified.setSectionAsPublic in interface PropertyFileDatasection - the section to mark as "public"public 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.