Class FacetBase<V>

java.lang.Object
net.kyori.adventure.platform.facet.FacetBase<V>
Type Parameters:
V - the viewer type
All Implemented Interfaces:
Facet<V>

public abstract class FacetBase<V> extends Object implements Facet<V>
A base implementation of a facet that validates viewer type.

This is not supported API. Subject to change at any time.

Since:
4.0.0
  • Field Details

    • viewerClass

      protected final Class<? extends V> viewerClass
  • Constructor Details

    • FacetBase

      protected FacetBase(@Nullable @Nullable Class<? extends V> viewerClass)
  • Method Details

    • isSupported

      public boolean isSupported()
      Description copied from interface: Facet
      Gets whether this handler is supported by the current runtime.

      If not, this can be discarded since it will fail for all viewers.

      Specified by:
      isSupported in interface Facet<V>
      Returns:
      if this handler is supported
    • isApplicable

      public boolean isApplicable(@NotNull V viewer)
      Description copied from interface: Facet
      Gets whether this handler is applicable to a particular viewer.

      This should only be invoked if Facet.isSupported() is true.

      Specified by:
      isApplicable in interface Facet<V>
      Parameters:
      viewer - a viewer
      Returns:
      if this handler is applicable to a viewer