public class Limits extends Object implements Serializable
Limit
s.Constructor and Description |
---|
Limits()
Default constructor
|
Limits(Limits other)
Copy constructor (no deep-copy)
|
Modifier and Type | Method and Description |
---|---|
void |
add(Limit limit)
Add a limit.
|
<L extends Limit> |
get(Class<L> type) |
<L extends Limit> |
get(Class<L> type,
Limit.WhenExceedAction action) |
<L extends Limit> |
getMostRestrictive(Class<L> type,
Limit.WhenExceedAction action)
Find the most restrictive
Limit of the the given type and exceed action |
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 . |
boolean |
remove(Limit limit)
Remove a previously applied
Limit . |
public Limits()
public Limits(Limits other)
other
- they instance to copy – Limits will not be cloned.public void add(Limit limit)
public boolean remove(Limit limit)
Limit
. This call will have no effect, if the limit has not
been applied previously.limit
- The limit to removetrue
iff the limit to remove was contained in this containerpublic <L extends Limit> Collection<L> get(Class<L> type)
public <L extends Limit> Collection<L> get(Class<L> type, Limit.WhenExceedAction action)
public <L extends Limit> L getMostRestrictive(Class<L> type, Limit.WhenExceedAction action)
Limit
of the the given type and exceed action
public Limits merge(Limits other, boolean ignoreAborts)
l
. If ignoreAborts
is set to true
, all
limits with Action Limit.WhenExceedAction.ABORT
from the instance l
are dropped.other
- the Limits to merge withCopyright © 2017 levigo holding gmbh. All rights reserved.