Interface DraftPunishment

All Superinterfaces:
DraftSanction, EnforcementOptionsFactory, PunishmentBase, SanctionBase

public interface DraftPunishment extends PunishmentBase, DraftSanction
A punishment ready to be created. Does not yet have an ID or start and end time, but does contain a duration.
  • Method Details

    • getDuration

      Duration getDuration()
      Gets the duration of this draft punishment
      Returns:
      the duration
    • enactPunishment

      default space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> enactPunishment()
      Description copied from interface: DraftSanction
      Enacts 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. See space.arim.libertybans.api.punish for a description of active and historical punishments.
      Specified by:
      enactPunishment in interface DraftSanction
      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: DraftSanction
      Enacts 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. See space.arim.libertybans.api.punish for a description of active and historical punishments.
      Specified by:
      enactPunishment in interface DraftSanction
      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

      Creates a new DraftPunishmentBuilder, copying all properties of this draft.
      Returns:
      A new builder
    • equals

      boolean equals(Object object)
      Description copied from interface: DraftSanction
      Whether this draft sanction is equal to another. The other draft sanction must have the same details as this one
      Specified by:
      equals in interface DraftSanction
      Overrides:
      equals in class Object
      Parameters:
      object - the object to determine equality with
      Returns:
      true if equal, false otherwise