Class Limits

    • Constructor Detail

      • Limits

        public Limits()
        Default constructor
      • Limits

        public Limits​(Limits other)
        Copy constructor (no deep-copy)
        Parameters:
        other - they instance to copy – Limits will not be cloned.
    • Method Detail

      • add

        public void add​(Limit limit)
        Add a limit.
        Parameters:
        limit - the Limit to be added
      • remove

        public boolean remove​(Limit limit)
        Remove a previously applied Limit. This call will have no effect, if the limit has not been applied previously.
        Parameters:
        limit - The limit to remove
        Returns:
        true iff the limit to remove was contained in this container
      • getMostRestrictive

        public <L extends Limit> L getMostRestrictive​(Class<L> type,
                                                      Limit.WhenExceedAction action)
        Find the most restrictive Limit of the the given type and exceed action
        Type Parameters:
        L - The Limit type
        Parameters:
        type - The requested Limit type's class
        action - The requested exceed action
        Returns:
        the most restrictive limit or null if no Limit matches the requirements
        Since:
        jadice server 4.3.1.0
      • merge

        public Limits merge​(Limits other,
                            boolean ignoreAborts)
        Return new Limits which contains the limits of this instance merged with the limits represented by the parameter l. If ignoreAborts is set to true, all limits with Action Limit.WhenExceedAction.ABORT from the instance l are dropped.
        Parameters:
        other - the Limits to merge with
        ignoreAborts - whether or not to ignore abort actions
        Returns:
        the merged Limits