public abstract class AbstractRecord extends Object implements Record
| Modifier and Type | Field and Description |
|---|---|
protected Set<String> |
aggregatedFields |
protected Map<String,List<FieldAction>> |
computation |
protected Set<String> |
computedFields |
protected static String |
CREATION_TIME |
protected static String |
ID |
protected Set<String> |
requiredFields |
protected Map<String,Serializable> |
resourceProperties
resource-specific properties
|
protected Map<String,List<FieldAction>> |
validation |
RECORD_TYPE| Constructor and Description |
|---|
AbstractRecord() |
AbstractRecord(Map<String,? extends Serializable> properties) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanExtraFields() |
int |
compareTo(Record record)
Compare this Record instance with the one provided as argument
|
protected void |
computeField(String key) |
Set<String> |
getAggregatedFields() |
protected static Set<Field> |
getAllFields(Class<?> type) |
Set<String> |
getComputedFields() |
Calendar |
getCreationTime()
Return the instant when this
Record was created. |
protected Calendar |
getEndTimeAsCalendar()
Return the right end of the time interval covered by this Record
|
protected long |
getEndTimeInMillis()
Return the right end of the time interval covered by this Record
|
String |
getId()
Return the unique id for this
Record |
protected int |
getOperationCount() |
SortedSet<String> |
getQuerableKeys() |
Set<String> |
getRequiredFields() |
Map<String,Serializable> |
getResourceProperties()
Return all resource-specific properties.
|
Serializable |
getResourceProperty(String key)
Return the value of the given resource property.
|
protected Calendar |
getStartTimeAsCalendar()
Return the left end of the time interval covered by this Record
|
protected long |
getStartTimeInMillis()
Return the left end of the time interval covered by this Record
|
protected void |
init()
Initialize variable
|
protected void |
initializeValidation() |
protected Boolean |
isAggregated() |
void |
removeResourceProperty(String key)
Remove a property from Record.
|
protected void |
setAggregated(Boolean aggregate)
Set the boolean aggregate by this Record
|
void |
setCreationTime(Calendar creationTime)
The CreationTime is automatically created by the implementation Class.
|
protected void |
setEndTime(Calendar endTime)
Set the right end of the time interval covered by this Record
|
void |
setId(String id)
The ID SHOULD be automatically created by the implementation Class.
|
protected void |
setOperationCount(int operationCount) |
void |
setResourceProperties(Map<String,? extends Serializable> properties)
Set all resource-specific properties, replacing existing ones
|
void |
setResourceProperty(String key,
Serializable value)
Set the value of the given resource property.
|
protected void |
setStartTime(Calendar startTime)
Set the left end of the time interval covered by this Record
|
static Calendar |
timestampToCalendar(long millis) |
String |
toString() |
void |
validate()
Validate the Resource Record.
|
protected Serializable |
validateField(String key,
Serializable value) |
protected Map<String,? extends Serializable> |
validateProperties(Map<String,? extends Serializable> properties) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetRecordTypeprotected static final String ID
protected static final String CREATION_TIME
protected Map<String,Serializable> resourceProperties
protected Map<String,List<FieldAction>> validation
protected Map<String,List<FieldAction>> computation
public AbstractRecord()
public AbstractRecord(Map<String,? extends Serializable> properties) throws InvalidValueException
InvalidValueExceptionprotected void initializeValidation()
public SortedSet<String> getQuerableKeys() throws Exception
getQuerableKeys in interface RecordExceptionprotected void cleanExtraFields()
protected void init()
public Set<String> getRequiredFields()
getRequiredFields in interface Recordpublic Set<String> getComputedFields()
getComputedFields in interface Recordpublic void setId(String id) throws InvalidValueException
RecordsetId in interface Recordid - Unique IDInvalidValueExceptionpublic static Calendar timestampToCalendar(long millis)
public Calendar getCreationTime()
Record was created.getCreationTime in interface RecordRecordpublic void setCreationTime(Calendar creationTime) throws InvalidValueException
Record was created.setCreationTime in interface RecordcreationTime - Creation TimeInvalidValueExceptionpublic Map<String,Serializable> getResourceProperties()
getResourceProperties in interface Recordpublic void setResourceProperties(Map<String,? extends Serializable> properties) throws InvalidValueException
setResourceProperties in interface RecordInvalidValueExceptionpublic Serializable getResourceProperty(String key)
getResourceProperty in interface Recordkey - the key of the requested propertypublic void removeResourceProperty(String key)
RecordremoveResourceProperty in interface Recordkey - the key of the requested property to removepublic void setResourceProperty(String key, Serializable value) throws InvalidValueException
setResourceProperty in interface Recordkey - the key of the requested propertyvalue - the value of the given resource propertyInvalidValueExceptionprotected void setEndTime(Calendar endTime) throws InvalidValueException
endTime - End TimeInvalidValueExceptionprotected long getEndTimeInMillis()
protected Calendar getEndTimeAsCalendar()
protected int getOperationCount()
protected void setOperationCount(int operationCount)
throws InvalidValueException
InvalidValueExceptionprotected long getStartTimeInMillis()
protected Calendar getStartTimeAsCalendar()
protected void setStartTime(Calendar startTime) throws InvalidValueException
startTime - Start TimeInvalidValueExceptionprotected void setAggregated(Boolean aggregate) throws InvalidValueException
aggregate - InvalidValueExceptionprotected Boolean isAggregated()
protected Serializable validateField(String key, Serializable value) throws InvalidValueException
InvalidValueExceptionprotected void computeField(String key) throws InvalidValueException
InvalidValueExceptionprotected Map<String,? extends Serializable> validateProperties(Map<String,? extends Serializable> properties) throws InvalidValueException
InvalidValueExceptionpublic void validate()
throws InvalidValueException
validate in interface RecordInvalidValueExceptionpublic int compareTo(Record record)
compareTo in interface Comparable<Record>record - the Record to compareCopyright © 2019. All Rights Reserved.