Class TransferZoneGroupImpl

    • Field Detail

      • transferZoneMap

        protected Map<Long,​TransferZone> transferZoneMap
        Map storing all the transfer zones in the group
      • name

        protected String name
        name of the transfer zone group
    • Constructor Detail

      • TransferZoneGroupImpl

        protected TransferZoneGroupImpl​(IdGroupingToken tokenId)
        Constructor
        Parameters:
        tokenId - to use
      • TransferZoneGroupImpl

        public TransferZoneGroupImpl​(TransferZoneGroupImpl other,
                                     boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • recreateTransferZoneIdMapping

        protected void recreateTransferZoneIdMapping()
        recreate the mapping such that all the keys used for each transfer zone reflect their internal id. To be called whenever the ids of transfer zones are changed
      • generateTransferZoneGroupId

        protected static long generateTransferZoneGroupId​(IdGroupingToken tokenId)
        generate unique transfer zone group id
        Parameters:
        tokenId - contiguous id generation within this group for instances of this class
        Returns:
        odZoneId
      • setName

        public void setName​(String name)
        set Name of the group
        Specified by:
        setName in interface TransferZoneGroup
        Parameters:
        name - to set
      • addTransferZone

        public TransferZone addTransferZone​(TransferZone transferZone)
        Add a transferZone and also register this group on this transfer zone at the same time
        Specified by:
        addTransferZone in interface TransferZoneGroup
        Parameters:
        transferZone - to add
        Returns:
        previousTransferZone under same id (if any)
      • removeTransferZone

        public TransferZone removeTransferZone​(TransferZone transferZone)
        remove a transfer zone from the group, and also remove the reference on the transfer zone at the same time
        Specified by:
        removeTransferZone in interface TransferZoneGroup
        Parameters:
        transferZone - to remove
        Returns:
        removed transfer zone
      • hasTransferZone

        public boolean hasTransferZone​(TransferZone transferZone)
        Verify if transfer zone is present
        Specified by:
        hasTransferZone in interface TransferZoneGroup
        Parameters:
        transferZone - to check
        Returns:
        true when present, false otherwise
      • size

        public int size()
        Number of registered transfer zones
        Specified by:
        size in interface TransferZoneGroup
        Returns:
        number of registered transfer zones
      • recreateManagedIds

        public long recreateManagedIds​(IdGroupingToken tokenId)
        recreate the internal id(s) and set them including the Idable id
        Specified by:
        recreateManagedIds in interface ManagedId
        Parameters:
        tokenId - to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))
        Returns:
        the updated internal id
      • deepClone

        public TransferZoneGroupImpl deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in interface TransferZoneGroup
        Overrides:
        deepClone in class ExternalIdAbleImpl
        Returns:
        deep copy of entity