Class ProductSummary

java.lang.Object
gov.usgs.earthquake.indexer.ProductSummary

public class ProductSummary extends Object
A ProductSummary is essentially a product without its contents. These are usually created by IndexerModules, which may inspect Product Content to add additional summary properties.
  • Constructor Details

    • 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 Details

    • getIndexId

      public Long getIndexId()
      Returns:
      indexId
    • setIndexId

      public void setIndexId(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 String getStatus()
      Returns:
      status
    • setStatus

      public void setStatus(String status)
      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

      public Map<String,String> getProperties()
      Returns:
      the properties
    • setProperties

      public void setProperties(Map<String,String> properties)
      Parameters:
      properties - the properties to set
    • getLinks

      public Map<String,List<URI>> getLinks()
      Returns a reference to the links map.
      Returns:
      the links
    • setLinks

      public void setLinks(Map<String,List<URI>> links)
      Copies entries from provided map.
      Parameters:
      links - the links to set
    • addLink

      public void addLink(String relation, URI href)
      Add a link to a product.
      Parameters:
      relation - how link is related to product.
      href - actual link.
    • getEventId

      public String getEventId()
      Returns:
      null or eventId
    • getEventSource

      public String getEventSource()
      Returns:
      eventSource
    • setEventSource

      public void setEventSource(String eventSource)
      Parameters:
      eventSource - to set
    • getEventSourceCode

      public String getEventSourceCode()
      Returns:
      eventSourceCode
    • setEventSourceCode

      public void setEventSourceCode(String eventSourceCode)
      Parameters:
      eventSourceCode - to set
    • getEventTime

      public Date getEventTime()
      Returns:
      eventTime
    • setEventTime

      public void setEventTime(Date eventTime)
      Parameters:
      eventTime - to set
    • getEventLatitude

      public BigDecimal getEventLatitude()
      Returns:
      eventLatitude
    • setEventLatitude

      public void setEventLatitude(BigDecimal eventLatitude)
      Parameters:
      eventLatitude - to set
    • getEventLongitude

      public BigDecimal getEventLongitude()
      Returns:
      eventLongitude
    • setEventLongitude

      public void setEventLongitude(BigDecimal eventLongitude)
      Parameters:
      eventLongitude - to set
    • getEventDepth

      public BigDecimal getEventDepth()
      Returns:
      eventDepth
    • setEventDepth

      public void setEventDepth(BigDecimal eventDepth)
      Parameters:
      eventDepth - to set
    • getEventMagnitude

      public BigDecimal getEventMagnitude()
      Returns:
      eventMagnitude
    • setEventMagnitude

      public void setEventMagnitude(BigDecimal eventMagnitude)
      Parameters:
      eventMagnitude - to set
    • getVersion

      public String getVersion()
      Returns:
      version
    • setVersion

      public void setVersion(String version)
      Parameters:
      version - to set
    • getType

      public String getType()
      Returns:
      type
    • getSource

      public String getSource()
      Returns:
      source
    • getCode

      public String getCode()
      Returns:
      code
    • getUpdateTime

      public Date getUpdateTime()
      Returns:
      updateTime
    • equals

      public boolean equals(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:
      equals in class Object
    • hashCode

      public int hashCode()
      Generate hashcode for ProductId using all components. This implementation just uses hashcode from ProductId.
      Overrides:
      hashCode in class Object