Class ProductSummary


  • public class ProductSummary
    extends java.lang.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 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:
        equals in class java.lang.Object
      • hashCode

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