Klasse SelectionItem

java.lang.Object
de.dlr.proseo.model.util.SelectionItem

public class SelectionItem extends Object
This class describes a selectable item consisting of an item type (auxiliary product type), a validity start time, a validity end time, and the original object for which the selection shall be effected. As this is only a support structure, all instance variables are publicly accessible.
Autor:
Dr. Thomas Bassler
  • Felddetails

    • itemType

      public String itemType
      The product type of the item
    • startTime

      public Instant startTime
      The start time of the item validity period
    • stopTime

      public Instant stopTime
      The end time of the item validity period
    • generationTime

      public Instant generationTime
      The generation time of the item
    • itemObject

      public Object itemObject
      The original object belonging to the item
  • Konstruktordetails

    • SelectionItem

      public SelectionItem()
      Default constructor
    • SelectionItem

      public SelectionItem(String itemType, Instant startTime, Instant stopTime, Instant generationTime, Object itemObject)
      Convenience constructor to create a SelectionItem with all attributes set at once.
      Parameter:
      itemType - the item product type to set
      startTime - the start time of the item validity period
      stopTime - the end time of the item validity period
      generationTime - the generation time of the item
      itemObject - the original object belonging to the item
  • Methodendetails

    • fromProduct

      public static SelectionItem fromProduct(Product product)
      Create a selection item wrapped around the given product
      Parameter:
      product - the product to create the selection item from
      Gibt zurück:
      a selection item with the same product type and start, stop and generation times as the given product
    • asSelectionItems

      public static List<SelectionItem> asSelectionItems(Collection<Product> products)
      Creates a list of selection items from a collection of products
      Parameter:
      products - the products to add to the selection item list
      Gibt zurück:
      a list of selection items with the same product type and start, stop and generation times as the given products
    • setStartTime

      public void setStartTime(long time)
      Convenience method to set the validity start time from a Unix time value (milliseconds since 1970-01-01T00:00:00 UTC)
      Parameter:
      time - the time in milliseconds to set the start time from
    • setStartTime

      public void setStartTime(Date date)
      Convenience method to set the validity start time from a Java date object
      Parameter:
      date - the date object to set the start time from
    • setStopTime

      public void setStopTime(long time)
      Convenience method to set the validity end time from a Unix time value (milliseconds since 1970-01-01T00:00:00 UTC)
      Parameter:
      time - the time in milliseconds to set the end time from
    • setStopTime

      public void setStopTime(Date date)
      Convenience method to set the validity end time from a Java date object
      Parameter:
      date - the date object to set the end time from
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • hashCode

      public int hashCode()
      Setzt außer Kraft:
      hashCode in Klasse Object
    • equals

      public boolean equals(Object obj)
      Setzt außer Kraft:
      equals in Klasse Object