Package gov.usgs.earthquake.indexer
Class ProductSummary
java.lang.Object
gov.usgs.earthquake.indexer.ProductSummary
A ProductSummary is essentially a product without its contents.
These are usually created by
IndexerModule
s, which may inspect
Product Content to add additional summary properties.-
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor.ProductSummary
(ProductSummary copy) Copy constructor for ProductSummary.ProductSummary
(Product product) Create a ProductSummary from a product. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a link to a product.boolean
Compares two ProductSummaries to determine if they are equal.getCode()
getId()
getLinks()
Returns a reference to the links map.long
getType()
int
hashCode()
Generate hashcode for ProductId using all components.boolean
void
setEventDepth
(BigDecimal eventDepth) void
setEventLatitude
(BigDecimal eventLatitude) void
setEventLongitude
(BigDecimal eventLongitude) void
setEventMagnitude
(BigDecimal eventMagnitude) void
setEventSource
(String eventSource) void
setEventSourceCode
(String eventSourceCode) void
setEventTime
(Date eventTime) void
void
setIndexId
(Long indexId) void
Copies entries from provided map.void
setPreferredWeight
(long weight) void
setProperties
(Map<String, String> properties) void
void
setVersion
(String version)
-
Constructor Details
-
ProductSummary
public ProductSummary()Empty constructor. -
ProductSummary
Copy constructor for ProductSummary. Does a deep copy of properties and links maps. All other attributes are copied by reference.- Parameters:
copy
- product summary to copy.
-
ProductSummary
Create a ProductSummary from a product. All attributes are copied from the product, and preferredWeight is set to 1L.- Parameters:
product
- the product to summarize.
-
-
Method Details
-
getIndexId
- Returns:
- indexId
-
setIndexId
- Parameters:
indexId
- to set
-
getId
- Returns:
- product id
-
setId
- Parameters:
id
- to set
-
getStatus
- Returns:
- status
-
setStatus
- Parameters:
status
- to set
-
isDeleted
public boolean isDeleted()- Returns:
- if product is deleted
-
getPreferredWeight
public long getPreferredWeight()- Returns:
- preferredWeight
-
setPreferredWeight
public void setPreferredWeight(long weight) - Parameters:
weight
- to set
-
getProperties
- Returns:
- the properties
-
setProperties
- Parameters:
properties
- the properties to set
-
getLinks
Returns a reference to the links map.- Returns:
- the links
-
setLinks
Copies entries from provided map.- Parameters:
links
- the links to set
-
addLink
Add a link to a product.- Parameters:
relation
- how link is related to product.href
- actual link.
-
getEventId
- Returns:
- null or eventId
-
getEventSource
- Returns:
- eventSource
-
setEventSource
- Parameters:
eventSource
- to set
-
getEventSourceCode
- Returns:
- eventSourceCode
-
setEventSourceCode
- Parameters:
eventSourceCode
- to set
-
getEventTime
- Returns:
- eventTime
-
setEventTime
- Parameters:
eventTime
- to set
-
getEventLatitude
- Returns:
- eventLatitude
-
setEventLatitude
- Parameters:
eventLatitude
- to set
-
getEventLongitude
- Returns:
- eventLongitude
-
setEventLongitude
- Parameters:
eventLongitude
- to set
-
getEventDepth
- Returns:
- eventDepth
-
setEventDepth
- Parameters:
eventDepth
- to set
-
getEventMagnitude
- Returns:
- eventMagnitude
-
setEventMagnitude
- Parameters:
eventMagnitude
- to set
-
getVersion
- Returns:
- version
-
setVersion
- Parameters:
version
- to set
-
getType
- Returns:
- type
-
getSource
- Returns:
- source
-
getCode
- Returns:
- code
-
getUpdateTime
- Returns:
- updateTime
-
equals
Compares two ProductSummaries to determine if they are equal. This first implementation just considers the ProductId of each summary. This is probably not the best way to check for equality. -
hashCode
public int hashCode()Generate hashcode for ProductId using all components. This implementation just uses hashcode from ProductId.
-