Klasse DurationLevel

java.lang.Object
me.kzlyth.api.template.mute.DurationLevel

public class DurationLevel extends Object
Represents a duration level within a mute template.

Each duration level corresponds to a specific offense level and defines the mute duration and reason suffix that will be applied.

Example:


 MuteTemplateAPI templateAPI = api.getMuteTemplateAPI();
 MuteTemplate template = templateAPI.getTemplate("spam").join();
 if (template != null) {
     DurationLevel level1 = template.getDurations().get(0);
     getLogger().info("Level " + level1.getLevel() + " duration: " + level1.getDuration());
     getLogger().info("Reason suffix: " + level1.getReasonSuffix());
     getLogger().info("Is permanent: " + level1.isPermanent());
 }
 
Seit:
1.2.3
Autor:
Zenith-Studios
  • Konstruktordetails

    • DurationLevel

      public DurationLevel(int level, @NotNull @NotNull String duration, @NotNull @NotNull String reasonSuffix)
      Constructs a new DurationLevel object.
      Parameter:
      level - The offense level
      duration - The duration string
      reasonSuffix - The reason suffix
  • Methodendetails

    • getLevel

      public int getLevel()
      Gets the offense level.
      Gibt zurück:
      The offense level (1 = first offense, 2 = second offense, etc.)
    • getDuration

      @NotNull public @NotNull String getDuration()
      Gets the duration string.
      Gibt zurück:
      The duration string (e.g., "1d", "2h", "30m", "0" for permanent)
    • getReasonSuffix

      @NotNull public @NotNull String getReasonSuffix()
      Gets the reason suffix.
      Gibt zurück:
      The reason suffix to append to the reason (e.g., " (1st Offense)")
    • isPermanent

      public boolean isPermanent()
      Checks if this duration level represents a permanent mute.
      Gibt zurück:
      true if permanent (duration is "0"), false otherwise
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object