Package org.gcube.documentstore.records
Interface Record
- All Superinterfaces:
Comparable<Record>,Serializable
- All Known Subinterfaces:
AggregatedRecord<A,R>
- All Known Implementing Classes:
AbstractRecord
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionReturn the instant when thisRecordwas created.getId()Return the unique id for thisRecordReturn theRecordTypeReturn all resource-specific properties.Return the value of the given resource property.voidRemove a property from Record.voidsetCreationTime(Calendar creationTime) The CreationTime is automatically created by the implementation Class.voidThe ID SHOULD be automatically created by the implementation Class.voidsetResourceProperties(Map<String, ? extends Serializable> resourceSpecificProperties) Set all resource-specific properties, replacing existing onesvoidsetResourceProperty(String key, Serializable value) Set the value of the given resource property.voidvalidate()Validate the Resource Record.Methods inherited from interface java.lang.Comparable
compareTo
-
Field Details
-
Method Details
-
getRequiredFields
- Returns:
- a Set containing the keys of required fields The returned Set MUST be a copy of the internal representation. Any modification to the returned Set MUST not affect the object
-
getComputedFields
- Returns:
- a Set containing the keys of computed fields The returned Set MUST be a copy of the internal representation. Any modification to the returned Set MUST not affect the object
-
getQuerableKeys
- Returns:
- Querable Keys as SortedSet
- Throws:
Exception
-
getRecordType
String getRecordType()Return theRecordType- Returns:
RecordType
-
getId
String getId()Return the unique id for thisRecord- Returns:
RecordUnique ID
-
setId
The ID SHOULD be automatically created by the implementation Class. Set the ID only if you really know what you are going to do. Set the unique id for thisRecord- Parameters:
id- Unique ID- Throws:
InvalidValueException
-
getCreationTime
Calendar getCreationTime()Return the instant when thisRecordwas created.- Returns:
- the creation time for this
Record
-
setCreationTime
The CreationTime is automatically created by the implementation Class. Set the CreationTime only if you really know what you are going to do. Set the instant when thisRecordwas created.- Parameters:
creationTime- Creation Time- Throws:
InvalidValueException
-
getResourceProperties
Map<String,Serializable> getResourceProperties()Return all resource-specific properties. The returned Map is a copy of the internal representation. Any modification to the returned Map MUST not affect the object- Returns:
- a Map containing the properties
-
setResourceProperties
void setResourceProperties(Map<String, ? extends Serializable> resourceSpecificProperties) throws InvalidValueExceptionSet all resource-specific properties, replacing existing ones- Throws:
InvalidValueException
-
getResourceProperty
Return the value of the given resource property.- Parameters:
key- the key of the requested property- Returns:
- the value of the given resource property
-
setResourceProperty
Set the value of the given resource property. If the key has the value of one of the predefined property, the value is validated.- Parameters:
key- the key of the requested propertyvalue- the value of the given resource property- Throws:
InvalidValueException
-
removeResourceProperty
Remove a property from Record. This API is intended for intern use only.- Parameters:
key- the key of the requested property to remove
-
validate
Validate the Resource Record. The validation check if all the Required Field are set and has valid value.- Throws:
InvalidValueException
-