Interface SelectionOrderBuilder
- All Superinterfaces:
SelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>
public interface SelectionOrderBuilder
extends SelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>
Builder for
SelectionOrder. No required details-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds a selection from the details of this builder.limitToRetrieve(int limitToRetrieve) Sets the amount of punishments to retrieve.default SelectionOrderBuilderSets the operator matched.operators(SelectionPredicate<Operator> operators) Sets the operators matched.default SelectionOrderBuilderscope(ServerScope scope) Sets the scope matched.scopes(SelectionPredicate<ServerScope> scopes) Sets the scopes matched.Sets the time after which punishments will be retrieved.default SelectionOrderBuilderSets that only active punishments should be matched.selectActiveOnly(boolean selectActiveOnly) Sets whether only active punishments should be matched.default SelectionOrderBuilderSets that all punishments, not just those active, should be matched.skipFirstRetrieved(int skipCount) Sets the amount of punishments to skip when retrieving.default SelectionOrderBuildertype(PunishmentType type) Sets the punishment type matched.types(SelectionPredicate<PunishmentType> types) Sets the punishment types matched.default SelectionOrderBuilderSets the victim matched.victims(SelectionPredicate<Victim> victims) Sets the victims matched.default SelectionOrderBuildervictimType(Victim.VictimType victimType) Sets the victim type matched.victimTypes(SelectionPredicate<Victim.VictimType> victimTypes) Sets the victim types matched.Methods inherited from interface SelectionBuilderBase
escalationTrack, escalationTracks, seekBefore
-
Method Details
-
victim
Sets the victim matched. All are matched by default.
Please seevictims(SelectionPredicate)for how this interacts with composite victims.- Parameters:
victim- the victim- Returns:
- this builder
-
victims
Sets the victims matched. All are matched by default.
Composite victims have somewhat special handling which reflects their purpose as an "either-or" kind of victim. That is, specifying a composite victim in set of the accepted victims will select all punishments which partially but not entirely match that composite victim. Formally, if the selected victim is a composite victim, and its UUID matches the specified composite victim OR its address matches the specified composite, then the selected victim is matched.
For example, specifying a composite victim ofnew UUID(1, 1)and address 127.0.0.1 will match all composite victims whose UUID isnew UUID(1, 1)OR whose address is 127.0.0.1. However, specifying a composite victim will not match other kinds of victims.- Parameters:
victims- the victim predicate- Returns:
- this builder
-
victimType
Sets the victim type matched. All are matched by default.- Parameters:
victimType- the victim type to match- Returns:
- this builder
-
victimTypes
Sets the victim types matched. All are matched by default.- Parameters:
victimTypes- the victim types- Returns:
- this builder
-
type
Description copied from interface:SelectionBuilderBaseSets the punishment type matched. All are matched by default.- Specified by:
typein interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
type- the punishment type- Returns:
- this builder
-
types
Description copied from interface:SelectionBuilderBaseSets the punishment types matched. All are matched by default.- Specified by:
typesin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
types- the punishment type predicate- Returns:
- this builder
-
operator
Description copied from interface:SelectionBuilderBaseSets the operator matched. All are matched by default.- Specified by:
operatorin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
operator- the operator- Returns:
- this builder
-
operators
Description copied from interface:SelectionBuilderBaseSets the operators matched. All are matched by default.- Specified by:
operatorsin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
operators- the operator predicate- Returns:
- this builder
-
scope
Description copied from interface:SelectionBuilderBaseSets the scope matched. All are matched by default.- Specified by:
scopein interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
scope- the scope- Returns:
- this builder
-
scopes
Description copied from interface:SelectionBuilderBaseSets the scopes matched. All are matched by default.- Specified by:
scopesin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
scopes- the scope predicate- Returns:
- this builder
-
selectActiveOnly
Description copied from interface:SelectionBuilderBaseSets whether only active punishments should be matched. True by default, meaning only active punishments are selected.
Active punishments are those not expired and not undone.- Specified by:
selectActiveOnlyin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
selectActiveOnly- whether to select active punishments only- Returns:
- this builder
-
selectActiveOnly
Description copied from interface:SelectionBuilderBaseSets that only active punishments should be matched. Enabled by default, meaning only active punishments are selected.
Active punishments are those not expired and not undone.- Specified by:
selectActiveOnlyin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Returns:
- this builder
-
selectAll
Description copied from interface:SelectionBuilderBaseSets that all punishments, not just those active, should be matched. When this method is used, historical punishments and expired punishments are selected.
Active punishments are those not expired and not undone.- Specified by:
selectAllin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Returns:
- this builder
-
skipFirstRetrieved
Description copied from interface:SelectionBuilderBaseSets the amount of punishments to skip when retrieving. No punishments are skipped by default.
This method may be used to implement offset pagination of selected punishments, together withSelectionBuilderBase.limitToRetrieve(int).
Behavior is unspecified if this is used simultaneously withSelectionBuilderBase.seekAfter(Instant, long). Callers should consider the methods exclusive to avoid unspecified behavior.- Specified by:
skipFirstRetrievedin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
skipCount- the amount of punishments to skip- Returns:
- this builder
-
limitToRetrieve
Description copied from interface:SelectionBuilderBaseSets the amount of punishments to retrieve. Unlimited by default.
If this is used withSelectionBuilderBase.skipFirstRetrieved(int), the amount of punishments retrieved is still equal tolimitToRetrieve. In other words, this method is the same as SQL'sLIMITclause.- Specified by:
limitToRetrievein interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
limitToRetrieve- the amount of punishments to retrieve,0for unlimited- Returns:
- this builder
-
seekAfter
Description copied from interface:SelectionBuilderBaseSets the time after which punishments will be retrieved. Only punishments whose start time (Punishment.getStartDate()) is after or equal to the given value will be selected.
If a punishment has a start time equal tominimumStartTime, its ID will be checked againstminimumId. The punishment will then be selected if its ID is equal to or greater thanminimumId.
To reset this option to the default value, use a minimum start time ofInstant.EPOCH, in which case the minimum ID is ignored.
This method may be used to implement keyset pagination of selected punishments, together withSelectionBuilderBase.limitToRetrieve(int).
Behavior is unspecified if this is used simultaneously withSelectionBuilderBase.skipFirstRetrieved(int). Callers should consider the methods exclusive to avoid unspecified behavior.- Specified by:
seekAfterin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Parameters:
minimumStartTime- the minimum start time, orInstant.EPOCHto reset this optionminimumId- the minimum ID- Returns:
- this builder
-
build
SelectionOrder build()Description copied from interface:SelectionBuilderBaseBuilds a selection from the details of this builder. May be used repeatedly without side effects.- Specified by:
buildin interfaceSelectionBuilderBase<SelectionOrderBuilder, SelectionOrder>- Returns:
- a selection from this builder's details
-