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 Object
implements Examiner<R>
An abstract implementation of an examiner.
Since:
1.0.0
  • Constructor Details

    • AbstractExaminer

      public AbstractExaminer()
  • Method Details

    • examine

      public @NonNull R examine​(@Nullable 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 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 Collection<E> collection, @NonNull 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
    • examine

      public @NonNull R examine​(@NonNull String name, @NonNull Stream<? extends ExaminableProperty> properties)
      Description copied from interface: Examiner
      Examines.
      Specified by:
      examine in interface Examiner<R>
      Parameters:
      name - the examinable name
      properties - the examinable properties
      Returns:
      the result
    • examinable

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

      protected abstract <K,​ V> @NonNull R map​(@NonNull Map<K,​V> map, @NonNull Stream<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 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 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 DoubleStream stream)
      Examines a stream.
      Parameters:
      stream - the stream
      Returns:
      the result from examining a stream
    • stream

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

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