Class ReasonProvider

java.lang.Object
de.murmelmeister.murmelapi.bansystem.reason.ReasonProvider
All Implemented Interfaces:
Reason

public final class ReasonProvider extends Object implements Reason
  • Constructor Details

    • ReasonProvider

      public ReasonProvider(String tableName)
  • Method Details

    • createTable

      private void createTable(String tableName)
    • exists

      public boolean exists(int id)
      Description copied from interface: Reason
      Checks if a reason with the specified ID exists.
      Specified by:
      exists in interface Reason
      Parameters:
      id - The ID of the reason to check.
      Returns:
      True if a reason with the specified ID exists, false otherwise.
    • add

      public void add(String reason)
      Description copied from interface: Reason
      Adds a reason.
      Specified by:
      add in interface Reason
      Parameters:
      reason - The reason to be added.
    • remove

      public void remove(int id)
      Description copied from interface: Reason
      Removes a reason.
      Specified by:
      remove in interface Reason
      Parameters:
      id - The ID of the reason to be removed.
    • update

      public void update(int id, String reason)
      Description copied from interface: Reason
      Updates the reason with the specified ID.
      Specified by:
      update in interface Reason
      Parameters:
      id - The ID of the reason to update.
      reason - The updated reason.
    • get

      public String get(int id)
      Description copied from interface: Reason
      Retrieves a reason by its ID.
      Specified by:
      get in interface Reason
      Parameters:
      id - The ID of the reason to retrieve.
      Returns:
      The reason associated with the specified ID, represented as a string.