public class MetaData
extends java.util.HashMap<java.lang.String,java.lang.Object>
Constructor and Description |
---|
MetaData()
Default constructor.
|
MetaData(int initialCapacity)
Create a MetaData with a initial capacity.
|
MetaData(java.util.Map<java.lang.String,java.lang.Object> map)
Create a MetaData with a initial Map.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
boolean |
getBooleanValue(java.lang.String key)
Return true or false if the key associated value is a Boolean, or false if the key
does not exist or the value is not a Boolean.
|
MetaData |
getCompatibilityMetaData()
Return a MetaData that contains only the keys that are useful for compatibility check, that is, stripped of all non compatible keys.
|
int |
getIntegerValue(java.lang.String key)
Return the int value associated with the key, or -1 if the key
does not exist or the value is not an Integer.
|
java.lang.String |
getStringValue(java.lang.String key)
Return the String value associated with the key, or null if the key does not exist or the value is not a String.
|
int |
hashCode()
The hashcode of a MetaData is the same as the HashMap hashcode, except that it does
not take into account not comparable keys (see
isComparableKey(String) ). |
static boolean |
isComparableKey(java.lang.String key)
Return true if a key will be used for comparisons.
|
boolean |
isCompatibleWith(MetaData meta)
Same as
isCompatibleWith(MetaData, boolean) , with only partial compatibility. |
boolean |
isCompatibleWith(MetaData meta,
boolean complete)
Look if two MetaDatas are compatible.
|
boolean |
isEqual(java.lang.String key,
java.lang.Object value)
Return true if the key value for this MetaData is equal to another value.
|
static boolean |
isUserKey(java.lang.String key)
Return true if a key is a user key, so it can be presented to the user.
|
static void |
setNotComparableKeys(java.util.List<java.lang.String> notCompKeyList)
Set specific keys which will not be used for the comparison.
|
static void |
setSpecificKeys(java.util.List<java.lang.String> notCompKeyList,
java.util.List<java.lang.String> notUserKeysList)
Set specific keys which will have a specific behavior for all Metadatas.
|
static void |
setUserKeys(java.util.List<java.lang.String> notUserKeysList)
Set user keys.
|
public MetaData()
public MetaData(int initialCapacity)
initialCapacity
- the initial capacitypublic MetaData(java.util.Map<java.lang.String,java.lang.Object> map)
map
- the initial Mappublic static void setNotComparableKeys(java.util.List<java.lang.String> notCompKeyList)
notCompKeyList
- the List of keys which will not be used for MetaData comparisonsisComparableKey(String)
public static void setUserKeys(java.util.List<java.lang.String> notUserKeysList)
notUserKeysList
- the List of keys which must not be presented to the userpublic static void setSpecificKeys(java.util.List<java.lang.String> notCompKeyList, java.util.List<java.lang.String> notUserKeysList)
notCompKeyList
- the List of keys which will not be used for MetaData comparisonsnotUserKeysList
- the List of keys which must not be presented to the userisUserKey(String)
,
isComparableKey(String)
public static boolean isUserKey(java.lang.String key)
key
- the keypublic static boolean isComparableKey(java.lang.String key)
key
- the keypublic boolean getBooleanValue(java.lang.String key)
key
- the keypublic boolean isEqual(java.lang.String key, java.lang.Object value)
key
- the keyvalue
- the value to comparepublic java.lang.String getStringValue(java.lang.String key)
key
- the keypublic int getIntegerValue(java.lang.String key)
key
- the keypublic int hashCode()
isComparableKey(String)
).hashCode
in interface java.util.Map<java.lang.String,java.lang.Object>
hashCode
in class java.util.AbstractMap<java.lang.String,java.lang.Object>
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Map<java.lang.String,java.lang.Object>
equals
in class java.util.AbstractMap<java.lang.String,java.lang.Object>
public MetaData getCompatibilityMetaData()
public boolean isCompatibleWith(MetaData meta)
isCompatibleWith(MetaData, boolean)
, with only partial compatibility. Only the keys of
the MetaData to compare must match, meaning that there can be additional keys in this MetaData.meta
- the MetaData to compare withpublic boolean isCompatibleWith(MetaData meta, boolean complete)
meta
- the MetaData to compare withcomplete
- true if there must be equality for the MetaData keys, meaning that all properties in
each MetaData must match, false if only the keys of the MetaData to compare must match