public class FlexibleIDMap
extends java.util.HashMap<java.lang.String,java.lang.Object>
HashMap which allows easy access to objects
which share the same "main ID". The main ID is handled as an optional prefix
for get(Object).
Example:
When mapping parameters of a tool type extension, the base ID would be:
"com.example.myfunctionpackage.mytooltype."
Notice that the dot separator at the end must be included in the base ID
string.
The map would then be able return a mapped input parameter by either:
"input.myparameter"
or:
"com.example.myfunctionpackage.mytooltype.input.myparameter"
| Constructor and Description |
|---|
FlexibleIDMap(java.lang.String pMainID)
Creates a new flexible ID map.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
get(java.lang.Object pKey) |
java.lang.Object |
get(java.lang.Object pKey,
boolean pPreferName)
Attempts to get an object with the given key.
|
public FlexibleIDMap(java.lang.String pMainID)
pMainID - the base IDFlexibleIDMappublic java.lang.Object get(java.lang.Object pKey)
get in interface java.util.Map<java.lang.String,java.lang.Object>get in class java.util.HashMap<java.lang.String,java.lang.Object>public java.lang.Object get(java.lang.Object pKey,
boolean pPreferName)
pKey - the keypPreferName - whether to first treat the given key as a name (prepend the
base ID) before checking if it is fully qualified. It is
recommended to use true if the given key is more
likely a name. This is just a minor performance improvement
and will not change the outcome of the method.nullCopyright © 2015 Micro Focus GmbH. All rights reserved.