Interface SelectionBase

All Known Subinterfaces:
SelectionByApplicability, SelectionOrder

public interface SelectionBase
A selection which will match punishments in the database with certain details.
A punishment is said to match if it meets all of this selection's requirements.
  • Method Details

    • getTypes

      Gets the punishment types matched
      Returns:
      the punishment types
    • getOperators

      SelectionPredicate<Operator> getOperators()
      Gets the operators matched
      Returns:
      the operators
    • getScopes

      Gets the scopes matched
      Returns:
      the scopes
    • getEscalationTracks

      Gets the escalation tracks matched
      Returns:
      the escalation tracks
    • selectActiveOnly

      boolean selectActiveOnly()
      Whether this selection will match only active, non-expired punishments. If false, then this selection may match any punishments, including undone or expired punishments.
      Returns:
      true to select only active and non-expired punishments, false to select all punishments
    • skipCount

      int skipCount()
      Gets the initial amount of punishments skipped.

      See SelectionBuilderBase.skipFirstRetrieved(int)
      Returns:
      the amount of punishments skipped
    • limitToRetrieve

      int limitToRetrieve()
      Gets the amount of punishments to retrieve.

      See SelectionBuilderBase.limitToRetrieve(int)
      Returns:
      the amount to retrieve, or 0 for unlimited
    • seekAfterStartTime

      Instant seekAfterStartTime()
      Gets the minimum start time after which punishments will be selected.

      See SelectionBuilderBase.seekAfter(Instant, long)
      Returns:
      the minimum start time, or Instant.EPOCH for none
    • seekAfterId

      long seekAfterId()
      Gets the minimum ID after which punishments will be selected.

      See SelectionBuilderBase.seekAfter(Instant, long)
      Returns:
      the minimum ID, which is meaningless if seekAfterStartTime() is Instant.EPOCH
    • seekBeforeStartTime

      Instant seekBeforeStartTime()
      Gets the maximum start time before which punishments will be selected.

      See SelectionBuilderBase.seekBefore(Instant, long)
      Returns:
      the maximum start time, or Instant.MAX for none
    • seekBeforeId

      long seekBeforeId()
      Gets the maximum ID before which punishments will be selected.

      See SelectionBuilderBase.seekBefore(Instant, long)
      Returns:
      the maximum ID, which is meaningless if seekBeforeStartTime() is Instant.MAX
    • getFirstSpecificPunishment

      default space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> getFirstSpecificPunishment()
      Gets the first punishment matching this selection.

      If multiple punishments exist, the one chosen depends on the date enacted. The latest punishment will come first.
      Returns:
      a future which yields the first punishment matching this selection, or an empty optional if none matched
    • getFirstSpecificPunishment

      space.arim.omnibus.util.concurrent.ReactionStage<Optional<Punishment>> getFirstSpecificPunishment(SortPunishments... prioritization)
      Gets the first punishment matching this selection.

      If multiple punishments exist, the prioritization parameter determines which will be returned.
      Parameters:
      prioritization - how to evaluate which punishment comes first
      Returns:
      a future which yields the first punishment matching this selection, or an empty optional if none matched
    • getAllSpecificPunishments

      default space.arim.omnibus.util.concurrent.ReactionStage<List<Punishment>> getAllSpecificPunishments()
      Gets all punishments matching this selection.

      The returned list is ordered by the date the punishment was enacted. The latest punishments come first.
      Returns:
      a future which yields all punishments matching this selection, or an empty set if none matched
    • getAllSpecificPunishments

      space.arim.omnibus.util.concurrent.ReactionStage<List<Punishment>> getAllSpecificPunishments(SortPunishments... ordering)
      Gets all punishments matching this selection, ordered in the specified fashion.

      Using the ordering parameter is potentially superior to manually sorting the returned list, since it may perform ordering on the database side.
      Parameters:
      ordering - how to order the returned punishments
      Returns:
      a future which yields all punishments matching this selection, or an empty set if none matched
    • countNumberOfPunishments

      space.arim.omnibus.util.concurrent.ReactionStage<Integer> countNumberOfPunishments()
      Gets the number of punishments matching this selection.
      Returns:
      a future which yields the number of punishments matching this selection
    • equals

      boolean equals(Object object)
      Whether this punishment selection is equal to another, i.e. if the other selection would match the same punishments in all circumstances.
      Overrides:
      equals in class Object
      Parameters:
      object - the other object
      Returns:
      true if the objects are equal, false otherwise