Class FacetBase<V>

  • Type Parameters:
    V - the viewer type
    All Implemented Interfaces:
    Facet<V>

    public abstract class FacetBase<V>
    extends java.lang.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 Detail

      • viewerClass

        protected final java.lang.Class<? extends V> viewerClass
    • Constructor Detail

      • FacetBase

        protected FacetBase​(@Nullable
                            @Nullable java.lang.Class<? extends V> viewerClass)
    • Method Detail

      • 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