Class SocialChatRenderer.MapResult<T>

java.lang.Object
ovh.mythmc.social.api.chat.renderer.SocialChatRenderer.MapResult<T>
Type Parameters:
T - the renderer target type
Enclosing interface:
SocialChatRenderer<T>

@NonExtendable public abstract static class SocialChatRenderer.MapResult<T> extends Object
Represents the outcome of mapping an Audience to a renderer target.

Use success(Object) when mapping succeeded, ignore() to silently skip rendering without logging (e.g. the audience is not a player), or failure(String) internally when something unexpected went wrong.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> ovh.mythmc.social.api.chat.renderer.SocialChatRenderer.MapResult.Ignore<T>
    Creates an ignore result; rendering is skipped silently.
    boolean
    Returns true if this result represents a mapping failure that should be logged.
    boolean
    Returns true if this result represents a silent skip.
    boolean
    Returns true if this result represents a successful mapping.
    abstract T
    Returns the mapped target, or null for ignore/failure results.
    static <T> ovh.mythmc.social.api.chat.renderer.SocialChatRenderer.MapResult.Success<T>
    success(T result)
    Creates a successful mapping result.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MapResult

      public MapResult()
  • Method Details

    • result

      public abstract T result()
      Returns the mapped target, or null for ignore/failure results.
    • success

      public static <T> ovh.mythmc.social.api.chat.renderer.SocialChatRenderer.MapResult.Success<T> success(T result)
      Creates a successful mapping result.
      Type Parameters:
      T - the target type
      Parameters:
      result - the mapped target
      Returns:
      a success result
    • ignore

      public static <T> ovh.mythmc.social.api.chat.renderer.SocialChatRenderer.MapResult.Ignore<T> ignore()
      Creates an ignore result; rendering is skipped silently.
      Type Parameters:
      T - the target type
      Returns:
      an ignore result
    • isSuccess

      public boolean isSuccess()
      Returns true if this result represents a successful mapping.
    • isIgnored

      public boolean isIgnored()
      Returns true if this result represents a silent skip.
    • isFailure

      public boolean isFailure()
      Returns true if this result represents a mapping failure that should be logged.