Class AbstractExaminer<R>

java.lang.Object
net.kyori.examination.AbstractExaminer<R>
Type Parameters:
R - the result type
All Implemented Interfaces:
Examiner<R>

public abstract class AbstractExaminer<R>
extends java.lang.Object
implements Examiner<R>
An abstract implementation of an examiner.
  • Constructor Summary

    Constructors 
    Constructor Description
    AbstractExaminer()  
  • Method Summary

    Modifier and Type Method Description
    protected abstract <E> @NonNull R array​(@NonNull E[] array, @NonNull java.util.stream.Stream<R> elements)
    Examines an array.
    protected abstract <E> @NonNull R collection​(@NonNull java.util.Collection<E> collection, @NonNull java.util.stream.Stream<R> elements)
    Examines a collection.
    protected abstract @NonNull R examinable​(@NonNull Examinable examinable, @NonNull java.util.stream.Stream<java.util.Map.Entry<java.lang.String,​R>> properties)
    Examines an examinable.
    @NonNull R examine​(@Nullable java.lang.Object value)
    Examines.
    protected abstract <K,​ V> @NonNull R map​(@NonNull java.util.Map<K,​V> map, @NonNull java.util.stream.Stream<java.util.Map.Entry<R,​R>> entries)
    Examines a map.
    protected abstract @NonNull R nil()
    Examines null.
    protected abstract @NonNull R scalar​(@NonNull java.lang.Object value)
    Examines a scalar value.
    protected abstract @NonNull R stream​(@NonNull java.util.stream.DoubleStream stream)
    Examines a stream.
    protected abstract @NonNull R stream​(@NonNull java.util.stream.IntStream stream)
    Examines a stream.
    protected abstract @NonNull R stream​(@NonNull java.util.stream.LongStream stream)
    Examines a stream.
    protected abstract <T> @NonNull R stream​(@NonNull java.util.stream.Stream<T> stream)
    Examines a stream.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.kyori.examination.Examiner

    examine, examine, examine, examine, examine, examine, examine, examine, examine, examine, examine, examine, examine, examine, examine, examine, examine
  • Constructor Details

  • Method Details

    • examine

      public @NonNull R examine​(@Nullable java.lang.Object value)
      Description copied from interface: Examiner
      Examines.
      Specified by:
      examine in interface Examiner<R>
      Parameters:
      value - the value to examine
      Returns:
      the result
    • array

      protected abstract <E> @NonNull R array​(@NonNull E[] array, @NonNull java.util.stream.Stream<R> elements)
      Examines an array.
      Type Parameters:
      E - the element type
      Parameters:
      array - the array
      elements - the array elements
      Returns:
      the result from examining an array
    • collection

      protected abstract <E> @NonNull R collection​(@NonNull java.util.Collection<E> collection, @NonNull java.util.stream.Stream<R> elements)
      Examines a collection.
      Type Parameters:
      E - the element type
      Parameters:
      collection - the collection
      elements - the collection elements
      Returns:
      the result from examining a collection
    • examinable

      protected abstract @NonNull R examinable​(@NonNull Examinable examinable, @NonNull java.util.stream.Stream<java.util.Map.Entry<java.lang.String,​R>> properties)
      Examines an examinable.
      Parameters:
      examinable - the examinable
      properties - the examinable properties
      Returns:
      the result from examining an examinable
    • map

      protected abstract <K,​ V> @NonNull R map​(@NonNull java.util.Map<K,​V> map, @NonNull java.util.stream.Stream<java.util.Map.Entry<R,​R>> entries)
      Examines a map.
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      map - the map
      entries - the map entries
      Returns:
      the result from examining a map
    • nil

      protected abstract @NonNull R nil()
      Examines null.
      Returns:
      the result from examining null
    • scalar

      protected abstract @NonNull R scalar​(@NonNull java.lang.Object value)
      Examines a scalar value.
      Parameters:
      value - the scalar value
      Returns:
      the result from examining a scalar
    • stream

      protected abstract <T> @NonNull R stream​(@NonNull java.util.stream.Stream<T> stream)
      Examines a stream.
      Type Parameters:
      T - the type
      Parameters:
      stream - the stream
      Returns:
      the result from examining a stream
    • stream

      protected abstract @NonNull R stream​(@NonNull java.util.stream.DoubleStream stream)
      Examines a stream.
      Parameters:
      stream - the stream
      Returns:
      the result from examining a stream
    • stream

      protected abstract @NonNull R stream​(@NonNull java.util.stream.IntStream stream)
      Examines a stream.
      Parameters:
      stream - the stream
      Returns:
      the result from examining a stream
    • stream

      protected abstract @NonNull R stream​(@NonNull java.util.stream.LongStream stream)
      Examines a stream.
      Parameters:
      stream - the stream
      Returns:
      the result from examining a stream