Record Class ActionResult

java.lang.Object
java.lang.Record
su.nightexpress.excellentclaims.api.service.ActionResult

@NullMarked public record ActionResult(boolean result, ActionReason reason, @Nullable su.nightexpress.nightcore.locale.entry.MessageLocale locale, @Nullable Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders) extends Record
  • Constructor Summary

    Constructors
    Constructor
    Description
    ActionResult(boolean result, ActionReason reason, @Nullable su.nightexpress.nightcore.locale.entry.MessageLocale locale, @Nullable Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
    Creates an instance of a ActionResult record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
     
     
    fail(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
     
    fail(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
     
    fail(su.nightexpress.nightcore.locale.entry.MessageLocale locale)
     
    fail(su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
     
    boolean
     
    Optional<su.nightexpress.nightcore.locale.entry.MessageLocale>
     
    boolean
    handleFeedback(BiConsumer<su.nightexpress.nightcore.locale.entry.MessageLocale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder>> consumer)
     
    boolean
    handleFeedback(Consumer<su.nightexpress.nightcore.locale.entry.MessageLocale> consumer)
     
    final int
    Returns a hash code value for this object.
    boolean
    is(ActionReason reason)
     
    @Nullable su.nightexpress.nightcore.locale.entry.MessageLocale
    Returns the value of the locale record component.
    of(boolean result)
     
    of(boolean result, ActionReason reason)
     
    of(boolean result, ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
     
    of(boolean result, ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
     
    of(boolean result, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
     
    of(boolean result, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
     
    ok()
     
    ok(ActionReason reason)
     
    ok(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
     
    ok(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
     
    ok(su.nightexpress.nightcore.locale.entry.MessageLocale locale)
     
    ok(su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
     
    @Nullable Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder>
    Returns the value of the placeholders record component.
    Returns the value of the reason record component.
    boolean
    Returns the value of the result record component.
    boolean
     
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

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

    • ActionResult

      public ActionResult(boolean result, ActionReason reason, @Nullable su.nightexpress.nightcore.locale.entry.MessageLocale locale, @Nullable Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
      Creates an instance of a ActionResult record class.
      Parameters:
      result - the value for the result record component
      reason - the value for the reason record component
      locale - the value for the locale record component
      placeholders - the value for the placeholders record component
  • Method Details

    • of

      public static ActionResult of(boolean result)
    • of

      public static ActionResult of(boolean result, ActionReason reason)
    • of

      public static ActionResult of(boolean result, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
    • of

      public static ActionResult of(boolean result, ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
    • of

      public static ActionResult of(boolean result, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
    • of

      public static ActionResult of(boolean result, ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
    • ok

      public static ActionResult ok()
    • ok

      public static ActionResult ok(ActionReason reason)
    • ok

      public static ActionResult ok(su.nightexpress.nightcore.locale.entry.MessageLocale locale)
    • ok

      public static ActionResult ok(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
    • ok

      public static ActionResult ok(su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
    • ok

      public static ActionResult ok(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
    • fail

      public static ActionResult fail()
    • fail

      public static ActionResult fail(ActionReason reason)
    • fail

      public static ActionResult fail(su.nightexpress.nightcore.locale.entry.MessageLocale locale)
    • fail

      public static ActionResult fail(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale)
    • fail

      public static ActionResult fail(su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
    • fail

      public static ActionResult fail(ActionReason reason, su.nightexpress.nightcore.locale.entry.MessageLocale locale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders)
    • feedback

      public Optional<su.nightexpress.nightcore.locale.entry.MessageLocale> feedback()
    • handleFeedback

      public boolean handleFeedback(Consumer<su.nightexpress.nightcore.locale.entry.MessageLocale> consumer)
    • handleFeedback

      public boolean handleFeedback(BiConsumer<su.nightexpress.nightcore.locale.entry.MessageLocale, Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder>> consumer)
    • is

      public boolean is(ActionReason reason)
    • success

      public boolean success()
    • failure

      public boolean failure()
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • result

      public boolean result()
      Returns the value of the result record component.
      Returns:
      the value of the result record component
    • reason

      public ActionReason reason()
      Returns the value of the reason record component.
      Returns:
      the value of the reason record component
    • locale

      public @Nullable su.nightexpress.nightcore.locale.entry.MessageLocale locale()
      Returns the value of the locale record component.
      Returns:
      the value of the locale record component
    • placeholders

      public @Nullable Consumer<su.nightexpress.nightcore.util.placeholder.PlaceholderContext.Builder> placeholders()
      Returns the value of the placeholders record component.
      Returns:
      the value of the placeholders record component