Package gov.usgs.earthquake.indexer
Class ProductSummary
- java.lang.Object
-
- gov.usgs.earthquake.indexer.ProductSummary
-
public class ProductSummary extends java.lang.ObjectA ProductSummary is essentially a product without its contents. These are usually created byIndexerModules, which may inspect Product Content to add additional summary properties.
-
-
Constructor Summary
Constructors Constructor Description ProductSummary()Empty constructor.ProductSummary(ProductSummary copy)Copy constructor for ProductSummary.ProductSummary(Product product)Create a ProductSummary from a product.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLink(java.lang.String relation, java.net.URI href)Add a link to a product.booleanequals(java.lang.Object o)Compares two ProductSummaries to determine if they are equal.java.lang.StringgetCode()java.math.BigDecimalgetEventDepth()java.lang.StringgetEventId()java.math.BigDecimalgetEventLatitude()java.math.BigDecimalgetEventLongitude()java.math.BigDecimalgetEventMagnitude()java.lang.StringgetEventSource()java.lang.StringgetEventSourceCode()java.util.DategetEventTime()ProductIdgetId()java.lang.LonggetIndexId()java.util.Map<java.lang.String,java.util.List<java.net.URI>>getLinks()Returns a reference to the links map.longgetPreferredWeight()java.util.Map<java.lang.String,java.lang.String>getProperties()java.lang.StringgetSource()java.lang.StringgetStatus()java.net.URLgetTrackerURL()java.lang.StringgetType()java.util.DategetUpdateTime()java.lang.StringgetVersion()inthashCode()Generate hashcode for ProductId using all components.booleanisDeleted()voidsetEventDepth(java.math.BigDecimal eventDepth)voidsetEventLatitude(java.math.BigDecimal eventLatitude)voidsetEventLongitude(java.math.BigDecimal eventLongitude)voidsetEventMagnitude(java.math.BigDecimal eventMagnitude)voidsetEventSource(java.lang.String eventSource)voidsetEventSourceCode(java.lang.String eventSourceCode)voidsetEventTime(java.util.Date eventTime)voidsetId(ProductId id)voidsetIndexId(java.lang.Long indexId)voidsetLinks(java.util.Map<java.lang.String,java.util.List<java.net.URI>> links)Copies entries from provided map.voidsetPreferredWeight(long weight)voidsetProperties(java.util.Map<java.lang.String,java.lang.String> properties)voidsetStatus(java.lang.String status)voidsetTrackerURL(java.net.URL trackerURL)voidsetVersion(java.lang.String version)
-
-
-
Constructor Detail
-
ProductSummary
public ProductSummary()
Empty constructor.
-
ProductSummary
public ProductSummary(ProductSummary copy)
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
public ProductSummary(Product product)
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 Detail
-
getIndexId
public java.lang.Long getIndexId()
- Returns:
- indexId
-
setIndexId
public void setIndexId(java.lang.Long indexId)
- Parameters:
indexId- to set
-
getId
public ProductId getId()
- Returns:
- product id
-
setId
public void setId(ProductId id)
- Parameters:
id- to set
-
getStatus
public java.lang.String getStatus()
- Returns:
- status
-
setStatus
public void setStatus(java.lang.String status)
- Parameters:
status- to set
-
isDeleted
public boolean isDeleted()
- Returns:
- if product is deleted
-
getTrackerURL
public java.net.URL getTrackerURL()
- Returns:
- trackerURL
-
setTrackerURL
public void setTrackerURL(java.net.URL trackerURL)
- Parameters:
trackerURL- to set
-
getPreferredWeight
public long getPreferredWeight()
- Returns:
- preferredWeight
-
setPreferredWeight
public void setPreferredWeight(long weight)
- Parameters:
weight- to set
-
getProperties
public java.util.Map<java.lang.String,java.lang.String> getProperties()
- Returns:
- the properties
-
setProperties
public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties)
- Parameters:
properties- the properties to set
-
getLinks
public java.util.Map<java.lang.String,java.util.List<java.net.URI>> getLinks()
Returns a reference to the links map.- Returns:
- the links
-
setLinks
public void setLinks(java.util.Map<java.lang.String,java.util.List<java.net.URI>> links)
Copies entries from provided map.- Parameters:
links- the links to set
-
addLink
public void addLink(java.lang.String relation, java.net.URI href)Add a link to a product.- Parameters:
relation- how link is related to product.href- actual link.
-
getEventId
public java.lang.String getEventId()
- Returns:
- null or eventId
-
getEventSource
public java.lang.String getEventSource()
- Returns:
- eventSource
-
setEventSource
public void setEventSource(java.lang.String eventSource)
- Parameters:
eventSource- to set
-
getEventSourceCode
public java.lang.String getEventSourceCode()
- Returns:
- eventSourceCode
-
setEventSourceCode
public void setEventSourceCode(java.lang.String eventSourceCode)
- Parameters:
eventSourceCode- to set
-
getEventTime
public java.util.Date getEventTime()
- Returns:
- eventTime
-
setEventTime
public void setEventTime(java.util.Date eventTime)
- Parameters:
eventTime- to set
-
getEventLatitude
public java.math.BigDecimal getEventLatitude()
- Returns:
- eventLatitude
-
setEventLatitude
public void setEventLatitude(java.math.BigDecimal eventLatitude)
- Parameters:
eventLatitude- to set
-
getEventLongitude
public java.math.BigDecimal getEventLongitude()
- Returns:
- eventLongitude
-
setEventLongitude
public void setEventLongitude(java.math.BigDecimal eventLongitude)
- Parameters:
eventLongitude- to set
-
getEventDepth
public java.math.BigDecimal getEventDepth()
- Returns:
- eventDepth
-
setEventDepth
public void setEventDepth(java.math.BigDecimal eventDepth)
- Parameters:
eventDepth- to set
-
getEventMagnitude
public java.math.BigDecimal getEventMagnitude()
- Returns:
- eventMagnitude
-
setEventMagnitude
public void setEventMagnitude(java.math.BigDecimal eventMagnitude)
- Parameters:
eventMagnitude- to set
-
getVersion
public java.lang.String getVersion()
- Returns:
- version
-
setVersion
public void setVersion(java.lang.String version)
- Parameters:
version- to set
-
getType
public java.lang.String getType()
- Returns:
- type
-
getSource
public java.lang.String getSource()
- Returns:
- source
-
getCode
public java.lang.String getCode()
- Returns:
- code
-
getUpdateTime
public java.util.Date getUpdateTime()
- Returns:
- updateTime
-
equals
public boolean equals(java.lang.Object o)
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.- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
Generate hashcode for ProductId using all components. This implementation just uses hashcode from ProductId.- Overrides:
hashCodein classjava.lang.Object
-
-