Record Class CustomFlag

java.lang.Object
java.lang.Record
io.github.lijinhong11.protector.api.flag.CustomFlag
Record Components:
plugin - the plugin
namespace - the namespace for verify
id - the flag ID
defaultValue - the default value
displayName - the display name of the flag (optional)
description - the description about the flag (optional)

public record CustomFlag(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull String namespace, @NotNull String id, boolean defaultValue, @Nullable String displayName, @Nullable String description) extends Record
The custom flag object
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomFlag(@NotNull org.bukkit.plugin.Plugin plugin, @NotNull String namespace, @NotNull String id, boolean defaultValue, @Nullable String displayName, @Nullable String description)
    Creates an instance of a CustomFlag record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns the value of the defaultValue record component.
    @Nullable String
    Returns the value of the description record component.
    @Nullable String
    Returns the value of the displayName record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    @NotNull String
    id()
    Returns the value of the id record component.
    @NotNull String
    Returns the value of the namespace record component.
    @NotNull org.bukkit.plugin.Plugin
    Returns the value of the plugin record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • CustomFlag

      public CustomFlag(@NotNull @NotNull org.bukkit.plugin.Plugin plugin, @NotNull @NotNull String namespace, @NotNull @NotNull String id, boolean defaultValue, @Nullable @Nullable String displayName, @Nullable @Nullable String description)
      Creates an instance of a CustomFlag record class.
      Parameters:
      plugin - the value for the plugin record component
      namespace - the value for the namespace record component
      id - the value for the id record component
      defaultValue - the value for the defaultValue record component
      displayName - the value for the displayName record component
      description - the value for the description record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • plugin

      @NotNull public @NotNull org.bukkit.plugin.Plugin plugin()
      Returns the value of the plugin record component.
      Returns:
      the value of the plugin record component
    • namespace

      @NotNull public @NotNull String namespace()
      Returns the value of the namespace record component.
      Returns:
      the value of the namespace record component
    • id

      @NotNull public @NotNull String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • defaultValue

      public boolean defaultValue()
      Returns the value of the defaultValue record component.
      Returns:
      the value of the defaultValue record component
    • displayName

      @Nullable public @Nullable String displayName()
      Returns the value of the displayName record component.
      Returns:
      the value of the displayName record component
    • description

      @Nullable public @Nullable String description()
      Returns the value of the description record component.
      Returns:
      the value of the description record component