Interface DraftPunishment
- All Superinterfaces:
DraftSanction, EnforcementOptionsFactory, PunishmentBase, SanctionBase
A punishment ready to be created. Does not yet have an ID or start and end
time, but does contain a duration.
-
Method Summary
Modifier and TypeMethodDescriptiondefault space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> Enacts this sanction, adding it to the database as a punishment, then enforces it.space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> enactPunishment(EnforcementOptions enforcementOptions) Enacts this sanction, adding it to the database as a punishment, then enforces it according to the given options.booleanWhether this draft sanction is equal to another.Gets the duration of this draft punishmentCreates a newDraftPunishmentBuilder, copying all properties of this draft.Methods inherited from interface EnforcementOptionsFactory
enforcementOptionsBuilderMethods inherited from interface PunishmentBase
getEscalationTrack, getOperator, getReason, getScope, getType, getVictim
-
Method Details
-
getDuration
-
enactPunishment
Description copied from interface:DraftSanctionEnacts this sanction, adding it to the database as a punishment, then enforces it.
If the punishment type is a ban or mute, and there is already an active ban or mute for the victim, the future will yield an empty optional. Seespace.arim.libertybans.api.punishfor a description of active and historical punishments.- Specified by:
enactPunishmentin interfaceDraftSanction- Returns:
- a future which yields the punishment or an empty optional if there was a conflict
-
enactPunishment
space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> enactPunishment(EnforcementOptions enforcementOptions) Description copied from interface:DraftSanctionEnacts this sanction, adding it to the database as a punishment, then enforces it according to the given options.
If the punishment type is a ban or mute, and there is already an active ban or mute for the victim, the future will yield an empty optional. Seespace.arim.libertybans.api.punishfor a description of active and historical punishments.- Specified by:
enactPunishmentin interfaceDraftSanction- Parameters:
enforcementOptions- the enforcement options. Can be used to disable enforcement entirely- Returns:
- a future which yields the punishment or an empty optional if there was a conflict
-
toBuilder
DraftPunishmentBuilder toBuilder()Creates a newDraftPunishmentBuilder, copying all properties of this draft.- Returns:
- A new builder
-
equals
Description copied from interface:DraftSanctionWhether this draft sanction is equal to another. The other draft sanction must have the same details as this one- Specified by:
equalsin interfaceDraftSanction- Overrides:
equalsin classObject- Parameters:
object- the object to determine equality with- Returns:
- true if equal, false otherwise
-