Class InventoryWithTimestamp

    • Constructor Detail

      • InventoryWithTimestamp

        public InventoryWithTimestamp​(String identifier)
        Parameters:
        identifier - inventory identifier
      • InventoryWithTimestamp

        public InventoryWithTimestamp​(String identifier,
                                      Long tagKeepTime)
        Parameters:
        identifier - inventory identifier
        tagKeepTime - the tag keep time (to disable automatic removing tags, set keep time to -1)
    • Method Detail

      • addTag

        public Long addTag​(String tag,
                           long timestamp)
        Parameters:
        tag - the tag to add
        timestamp - the tag found timestamp
        Returns:
        the tag last timestamp or null if the tag was not in inventory
      • addTags

        public List<String> addTags​(List<String> inventory,
                                    long timestamp)
        update the current inventory
        Parameters:
        inventory - List with the founded tag ids
        timestamp - inventory timestamp
        Returns:
        a List with all tags, who are new in the inventory
      • checkInventory

        public List<String> checkInventory()
        check the current inventory for tags there are no longer found
        Returns:
        a list with removed tags
      • getInventory

        public List<String> getInventory()
        Return the current inventory
        Returns:
        the current inventory
      • getKeepTime

        public long getKeepTime()
        Returns:
        the keepTime
      • setKeepTime

        public void setKeepTime​(Long keepTime)
        Parameters:
        keepTime - the keepTime to set
      • removeTag

        public Long removeTag​(String tagEid)
        Remove a tag from this list
        Parameters:
        tagEid - tag eid to remove
        Returns:
        the last tag timestamp
      • clear

        public List<String> clear()
        Remove all tags from the inventory
        Returns:
        List with removed tags
      • getIdentifier

        public String getIdentifier()
        Returns:
        the identifier