Interface Filtered<T>

Type Parameters:
T - type of value

public interface Filtered<T>
Denotes that this type is filterable by the client, and may be shown differently depending on the player's set configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the value shown to players with text filtering enabled.
    static <T> Filtered<T>
    of(T raw, @Nullable T filtered)
    Creates a filterable value.
    raw()
    Gets the unfiltered value.
  • Method Details

    • of

      @Contract(value="_, _ -> new", pure=true) static <T> Filtered<T> of(T raw, @Nullable T filtered)
      Creates a filterable value.
      Type Parameters:
      T - type of value
      Parameters:
      raw - the unfiltered value
      filtered - the value shown to players with text filtering enabled, or null to show them the raw value
      Returns:
      a new filterable value
    • raw

      @Contract(pure=true) T raw()
      Gets the unfiltered value.
      Returns:
      the unfiltered value
    • filtered

      @Contract(pure=true) @Nullable T filtered()
      Gets the value shown to players with text filtering enabled.
      Returns:
      the filtered value, or null if those players are shown the raw value