Class AbstractRecord

    • Method Detail

      • getAllFields

        protected static Set<Field> getAllFields​(Class<?> type)
      • initializeValidation

        protected void initializeValidation()
      • cleanExtraFields

        protected void cleanExtraFields()
      • init

        protected void init()
        Initialize variable
      • getRequiredFields

        public Set<String> getRequiredFields()
        Specified by:
        getRequiredFields in interface Record
        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

        public Set<String> getComputedFields()
        Specified by:
        getComputedFields in interface Record
        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
      • getAggregatedFields

        public Set<String> getAggregatedFields()
      • setId

        public void setId​(String id)
                   throws InvalidValueException
        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 this Record
        Specified by:
        setId in interface Record
        Parameters:
        id - Unique ID
        Throws:
        InvalidValueException
      • timestampToCalendar

        public static Calendar timestampToCalendar​(long millis)
      • setCreationTime

        public void setCreationTime​(Calendar creationTime)
                             throws InvalidValueException
        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 this Record was created.
        Specified by:
        setCreationTime in interface Record
        Parameters:
        creationTime - Creation Time
        Throws:
        InvalidValueException
      • getResourceProperties

        public 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
        Specified by:
        getResourceProperties in interface Record
        Returns:
        a Map containing the properties
      • getResourceProperty

        public Serializable getResourceProperty​(String key)
        Return the value of the given resource property.
        Specified by:
        getResourceProperty in interface Record
        Parameters:
        key - the key of the requested property
        Returns:
        the value of the given resource property
      • removeResourceProperty

        public void removeResourceProperty​(String key)
        Description copied from interface: Record
        Remove a property from Record. This API is intended for intern use only.
        Specified by:
        removeResourceProperty in interface Record
        Parameters:
        key - the key of the requested property to remove
      • setResourceProperty

        public void setResourceProperty​(String key,
                                        Serializable value)
                                 throws InvalidValueException
        Set the value of the given resource property. If the key has the value of one of the predefined property, the value is validated.
        Specified by:
        setResourceProperty in interface Record
        Parameters:
        key - the key of the requested property
        value - the value of the given resource property
        Throws:
        InvalidValueException
      • getEndTimeInMillis

        protected long getEndTimeInMillis()
        Return the right end of the time interval covered by this Record
        Returns:
        End Time
      • getEndTimeAsCalendar

        protected Calendar getEndTimeAsCalendar()
        Return the right end of the time interval covered by this Record
        Returns:
        End Time
      • getOperationCount

        protected int getOperationCount()
      • getStartTimeInMillis

        protected long getStartTimeInMillis()
        Return the left end of the time interval covered by this Record
        Returns:
        Start Time
      • getStartTimeAsCalendar

        protected Calendar getStartTimeAsCalendar()
        Return the left end of the time interval covered by this Record
        Returns:
        Start Time
      • isAggregated

        protected Boolean isAggregated()
      • compareTo

        public int compareTo​(Record record)
        Compare this Record instance with the one provided as argument
        Specified by:
        compareTo in interface Comparable<Record>
        Parameters:
        record - the Record to compare
        Returns:
        0 is and only if the Record provided as parameter contains all and ONLY the parameters contained in this instance. If the number of parameters differs, the methods return the difference between the number of parameter in this instance and the ones in the Record provided as parameter. If the size is the same but the Record provided as parameter does not contains all parameters in this instance, -1 is returned.