Class DefaultNotification

  • All Implemented Interfaces:
    Notification
    Direct Known Subclasses:
    URLNotification

    public class DefaultNotification
    extends java.lang.Object
    implements Notification
    A DefaultNotification is a implementation of the Notification interface. No location information is stored about products, and must be tracked separately.
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultNotification​(ProductId id, java.util.Date expirationDate, java.net.URL trackerURL)
      Construct a DefaultNotification.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(Notification that)
      A comparison method to see if two notifications are equal.
      java.util.Date getExpirationDate()
      How long the product is available.
      ProductId getProductId()
      The product that is available.
      java.net.URL getTrackerURL()
      A tracking url where status updates can be sent.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DefaultNotification

        public DefaultNotification​(ProductId id,
                                   java.util.Date expirationDate,
                                   java.net.URL trackerURL)
        Construct a DefaultNotification.
        Parameters:
        id - the product that is available.
        expirationDate - how long the product is available.
        trackerURL - where to send tracking updates.
    • Method Detail

      • getExpirationDate

        public java.util.Date getExpirationDate()
        Description copied from interface: Notification
        How long the product is available.
        Specified by:
        getExpirationDate in interface Notification
        Returns:
        how long the product is available.
      • getTrackerURL

        public java.net.URL getTrackerURL()
        Description copied from interface: Notification
        A tracking url where status updates can be sent.
        Specified by:
        getTrackerURL in interface Notification
        Returns:
        location to send tracking updates.
      • equals

        public boolean equals​(Notification that)
        A comparison method to see if two notifications are equal.
        Specified by:
        equals in interface Notification
        Parameters:
        that - Notification
        Returns:
        boolean