public class StaticCompositeMetadata extends Object implements CompositeMetadata
CompositeMetadata
containing no metadata.CompositeMetadata.MetadataType
Constructor and Description |
---|
StaticCompositeMetadata()
Constructor
|
StaticCompositeMetadata(Map<String,Object> metadata)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
copyTo(ModifiableCompositeMetadata metadata)
Copy the current
CompositeMetadata to the given composite metadata. |
BinaryMetadata |
getBinaryMetadata(String metadataName)
Returns the named metadata's value as
BinaryMetadata .If the metadata does not exist, an UnknownMetadataException is thrown. |
boolean |
getBoolean(String metadataName)
Returns the named metadata's value as boolean.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. |
boolean |
getBoolean(String metadataName,
boolean defaultValue)
Returns the named metadata's value as boolean.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned. |
boolean[] |
getBooleanArray(String metadataName)
Returns the named metadata's value as boolean array.
|
boolean[] |
getBooleanArray(String metadataName,
boolean[] defaultValues)
Returns the named metadata's value as boolean array.
If the metadata does not exist, the default values are returned. |
CompositeMetadata |
getCompositeMetadata(String metadataName)
Returns the named metadata's value as
CompositeMetadata .If the metadata is multi-valued, one of the value is returned. If the metadata does not exist an UnknownMetadataException is thrown. |
Date |
getDate(String metadataName)
Returns the named metadata's value as Date.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. |
Date |
getDate(String metadataName,
Date defaultValue)
Returns the named metadata's value as Date.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned. |
Date[] |
getDateArray(String metadataName)
Returns the named metadata's value as Date array.
|
Date[] |
getDateArray(String metadataName,
Date[] defaultValues)
Returns the named metadata's value as Date array.
If the metadata does not exist, the default values are returned. |
double |
getDouble(String metadataName)
Returns the named metadata's value as double.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. |
double |
getDouble(String metadataName,
double defaultValue)
Returns the named metadata's value as double.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned. |
double[] |
getDoubleArray(String metadataName)
Returns the named metadata's value as double array.
|
double[] |
getDoubleArray(String metadataName,
double[] defaultValues)
Returns the named metadata's value as double array.
If the metadata does not exist, the default values are returned. |
String |
getLocalizedString(String metadataName,
Locale locale)
Returns the named metadata's value of a multilingual metadata as String.
|
String |
getLocalizedString(String metadataName,
Locale locale,
String defaultValue)
Returns the named metadata's value of a multilingual metadata as String.
If the metadata does not exist, the default value is returned. |
long |
getLong(String metadataName)
Returns the named metadata's value as long.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. |
long |
getLong(String metadataName,
long defaultValue)
Returns the named metadata's value as long.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned. |
long[] |
getLongArray(String metadataName)
Returns the named metadata's value as long array.
|
long[] |
getLongArray(String metadataName,
long[] defaultValues)
Returns the named metadata's value as long array.
If the metadata does not exist, the default values are returned. |
String[] |
getMetadataNames()
Returns an array containing metadata names.
|
MultilingualString |
getMultilingualString(String metadataName)
Returns the named metadata's values of a multilingual metadata.
|
TraversableAmetysObject |
getObjectCollection(String metadataName)
Returns an object collection metadata as a
TraversableAmetysObject . |
RichText |
getRichText(String metadataName)
Returns the named metadata's value as
RichText .If the metadata does not exist, an UnknownMetadataException is thrown. |
String |
getString(String metadataName)
Returns the named metadata's value as String.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, an UnknownMetadataException is thrown. |
String |
getString(String metadataName,
String defaultValue)
Returns the named metadata's value as String.
If the metadata is multi-valued, one of the value is returned. If the metadata does not exist, the default value is returned. |
String[] |
getStringArray(String metadataName)
Returns the named metadata's value as String array.
|
String[] |
getStringArray(String metadataName,
String[] defaultValues)
Returns the named metadata's value as String array.
If the metadata does not exist, the default values are returned. |
CompositeMetadata.MetadataType |
getType(String metadataName)
Returns the type of the given metadata.
|
UserIdentity |
getUser(String metadataName)
Returns the named metadata's value as
UserIdentity .If the metadata does not exist, an UnknownMetadataException is thrown. |
UserIdentity |
getUser(String metadataName,
UserIdentity defaultValue)
Returns the named metadata's value as
UserIdentity .If the metadata does not exist, the default value is returned. |
UserIdentity[] |
getUserArray(String metadataName)
Returns the named metadata's value as
UserIdentity array. |
UserIdentity[] |
getUserArray(String metadataName,
UserIdentity[] defaultValues)
Returns the named metadata's value as
UserIdentity array.If the metadata does not exist, the default values are returned. |
boolean |
hasMetadata(String metadataName)
Tests if a metadata with a given name exists.
|
boolean |
isMultiple(String metadataName)
Test if the given metadata is multiple.
|
public StaticCompositeMetadata()
public StaticCompositeMetadata(Map<String,Object> metadata)
metadata
- the composite metadatapublic BinaryMetadata getBinaryMetadata(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
BinaryMetadata
.UnknownMetadataException
is thrown.getBinaryMetadata
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public boolean getBoolean(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getBoolean
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public boolean getBoolean(String metadataName, boolean defaultValue) throws AmetysRepositoryException
CompositeMetadata
getBoolean
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public boolean[] getBooleanArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getBooleanArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public boolean[] getBooleanArray(String metadataName, boolean[] defaultValues) throws AmetysRepositoryException
CompositeMetadata
getBooleanArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.AmetysRepositoryException
- if an error occurs.public CompositeMetadata getCompositeMetadata(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
CompositeMetadata
.UnknownMetadataException
is thrown.getCompositeMetadata
in interface CompositeMetadata
metadataName
- the metadata name.CompositeMetadata
.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public void copyTo(ModifiableCompositeMetadata metadata) throws AmetysRepositoryException
CompositeMetadata
CompositeMetadata
to the given composite metadata.copyTo
in interface CompositeMetadata
metadata
- The parent composite metadata. Can not be null.AmetysRepositoryException
- if an error occurs.public Date getDate(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getDate
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public Date getDate(String metadataName, Date defaultValue) throws AmetysRepositoryException
CompositeMetadata
getDate
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public Date[] getDateArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getDateArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public Date[] getDateArray(String metadataName, Date[] defaultValues) throws AmetysRepositoryException
CompositeMetadata
getDateArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.AmetysRepositoryException
- if an error occurs.public double getDouble(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getDouble
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public double getDouble(String metadataName, double defaultValue) throws AmetysRepositoryException
CompositeMetadata
getDouble
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public double[] getDoubleArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getDoubleArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public double[] getDoubleArray(String metadataName, double[] defaultValues) throws AmetysRepositoryException
CompositeMetadata
getDoubleArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.AmetysRepositoryException
- if an error occurs.public long getLong(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getLong
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public long getLong(String metadataName, long defaultValue) throws AmetysRepositoryException
CompositeMetadata
getLong
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public long[] getLongArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getLongArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public long[] getLongArray(String metadataName, long[] defaultValues) throws AmetysRepositoryException
CompositeMetadata
getLongArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.AmetysRepositoryException
- if an error occurs.public String[] getMetadataNames() throws AmetysRepositoryException
CompositeMetadata
getMetadataNames
in interface CompositeMetadata
AmetysRepositoryException
- if an error occurs.public RichText getRichText(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
RichText
.UnknownMetadataException
is thrown.getRichText
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public String getString(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
UnknownMetadataException
is thrown.getString
in interface CompositeMetadata
metadataName
- the metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public String getString(String metadataName, String defaultValue) throws AmetysRepositoryException
CompositeMetadata
getString
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public String[] getStringArray(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getStringArray
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public String[] getStringArray(String metadataName, String[] defaultValues) throws AmetysRepositoryException
CompositeMetadata
getStringArray
in interface CompositeMetadata
metadataName
- metadata name.defaultValues
- the default values.AmetysRepositoryException
- if an error occurs.public String getLocalizedString(String metadataName, Locale locale) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getLocalizedString
in interface CompositeMetadata
metadataName
- the metadata name.locale
- the locale of value to retrieveUnknownMetadataException
- if the named metadata does not exist for the given locale.AmetysRepositoryException
- if an error occurs.public String getLocalizedString(String metadataName, Locale locale, String defaultValue) throws AmetysRepositoryException
CompositeMetadata
getLocalizedString
in interface CompositeMetadata
metadataName
- the metadata name.locale
- the locale of value to retrievedefaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public MultilingualString getMultilingualString(String metadataName) throws AmetysRepositoryException
CompositeMetadata
getMultilingualString
in interface CompositeMetadata
metadataName
- the metadata name.AmetysRepositoryException
- if an error occurs.public UserIdentity getUser(String metadataName) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
.UnknownMetadataException
is thrown.getUser
in interface CompositeMetadata
metadataName
- the metadata name.AmetysRepositoryException
- if an error occurs.public UserIdentity getUser(String metadataName, UserIdentity defaultValue) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
.getUser
in interface CompositeMetadata
metadataName
- the metadata name.defaultValue
- the default value.AmetysRepositoryException
- if an error occurs.public UserIdentity[] getUserArray(String metadataName) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
array.getUserArray
in interface CompositeMetadata
metadataName
- the metadata name.AmetysRepositoryException
- if an error occurs.public UserIdentity[] getUserArray(String metadataName, UserIdentity[] defaultValues) throws AmetysRepositoryException
CompositeMetadata
UserIdentity
array.getUserArray
in interface CompositeMetadata
metadataName
- the metadata name.defaultValues
- the default values.AmetysRepositoryException
- if an error occurs.public CompositeMetadata.MetadataType getType(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
getType
in interface CompositeMetadata
metadataName
- metadata name.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public boolean hasMetadata(String metadataName)
CompositeMetadata
hasMetadata
in interface CompositeMetadata
metadataName
- the metadataName to test.true
if the given metadata exists, false
otherwise.public boolean isMultiple(String metadataName) throws UnknownMetadataException, AmetysRepositoryException
CompositeMetadata
isMultiple
in interface CompositeMetadata
metadataName
- the metadata name.true
if the given metadata is multiple,
false
otherwise.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.public TraversableAmetysObject getObjectCollection(String metadataName) throws AmetysRepositoryException
CompositeMetadata
TraversableAmetysObject
getObjectCollection
in interface CompositeMetadata
metadataName
- the metadata name.TraversableAmetysObject
.UnknownMetadataException
- if the named metadata does not exist.AmetysRepositoryException
- if an error occurs.