Class TransferZoneImpl

    • Constructor Detail

      • TransferZoneImpl

        public TransferZoneImpl​(IdGroupingToken tokenId)
        constructor
        Parameters:
        tokenId - for id generation
      • TransferZoneImpl

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

      • generateTransferZoneId

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

        protected void setTransferZoneId​(long transferZoneId)
        Set transfer zone Id
        Parameters:
        transferZoneId - to set
      • getTransferZoneId

        public long getTransferZoneId()
        In addition to a zone id across all zones of any derived type, each transfer zone also has a unique id across the transfer zones specifically
        Specified by:
        getTransferZoneId in interface TransferZone
        Returns:
        transfer zone specific id
      • getTransferZonePlatformNames

        public List<String> getTransferZonePlatformNames()
        Unmodifiable list of registered platform names for this transfer zone (if any).
        Specified by:
        getTransferZonePlatformNames in interface TransferZone
        Returns:
        transfer zone platform names if any were registered
      • addTransferZonePlatformName

        public boolean addTransferZonePlatformName​(String platformName)
        Add platform name for this transfer zone
        Specified by:
        addTransferZonePlatformName in interface TransferZone
        Parameters:
        platformName - to add
        Returns:
        true if newly added, false otherwise
      • removeTransferZonePlatformName

        public boolean removeTransferZonePlatformName​(String platformName)
        Remove a platform name if present
        Specified by:
        removeTransferZonePlatformName in interface TransferZone
        Parameters:
        platformName - to remove
        Returns:
        true when removed, false otherwise
      • hasTransferZoneGroup

        public boolean hasTransferZoneGroup()
        Verify if a transfer zone is part of one or more transfer zone groups
        Specified by:
        hasTransferZoneGroup in interface TransferZone
        Returns:
        true when in transfer zone group, false otherwise
      • isInTransferZoneGroup

        public boolean isInTransferZoneGroup​(TransferZoneGroup transferZoneGroup)
        Verify if transfer zone is part of passed in transfer zone group
        Specified by:
        isInTransferZoneGroup in interface TransferZone
        Parameters:
        transferZoneGroup - to check
        Returns:
        true when part of group, false otherwise
      • addToTransferZoneGroup

        public void addToTransferZoneGroup​(TransferZoneGroup transferZoneGroup)
        register this transfer zone group as a group this transfer zone is part of
        Specified by:
        addToTransferZoneGroup in interface TransferZone
        Parameters:
        transferZoneGroup - to register as being part of
      • removeFromTransferZoneGroup

        public boolean removeFromTransferZoneGroup​(TransferZoneGroup transferZoneGroup)
        remove from transfer zone group provided and also remove ths transfer zone from group provided
        Specified by:
        removeFromTransferZoneGroup in interface TransferZone
        Parameters:
        transferZoneGroup - to remove ourselves as member from
        Returns:
        true when removal was successful, false otherwise
      • removeFromAllTransferZoneGroups

        public void removeFromAllTransferZoneGroups()
        remove this transfer zone from all groups it is registered on (and also update the group references
        Specified by:
        removeFromAllTransferZoneGroups in interface TransferZone
      • getTransferZoneGroups

        public final Set<TransferZoneGroup> getTransferZoneGroups()
        All transfer zone groups the transfer zone resides in (unmodifiable)
        Specified by:
        getTransferZoneGroups in interface TransferZone
        Returns:
        transfer zone groups of the transfer zone
      • recreateManagedIds

        public long recreateManagedIds​(IdGroupingToken tokenId)
        recreate the internal id(s) and set them including the Idable id
        Specified by:
        recreateManagedIds in interface ManagedId
        Overrides:
        recreateManagedIds in class ZoneImpl
        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 TransferZoneImpl 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 TransferZone
        Specified by:
        deepClone in interface Zone
        Specified by:
        deepClone in class ZoneImpl
        Returns:
        deep copy of entity