Class 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 Detail

      • AbstractExaminer

        public AbstractExaminer()
    • Method Detail

      • examine

        @NotNull
        public R examine​(@Nullable
                         @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

        @NotNull
        protected abstract <E> R array​(E @NotNull [] array,
                                       @NotNull
                                       @NotNull 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

        @NotNull
        protected abstract <E> R collection​(@NotNull
                                            @NotNull Collection<E> collection,
                                            @NotNull
                                            @NotNull 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

        @NotNull
        public R examine​(@NotNull
                         @NotNull String name,
                         @NotNull
                         @NotNull 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

        @NotNull
        protected abstract R examinable​(@NotNull
                                        @NotNull String name,
                                        @NotNull
                                        @NotNull 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

        @NotNull
        protected abstract <K,​V> R map​(@NotNull
                                             @NotNull Map<K,​V> map,
                                             @NotNull
                                             @NotNull 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

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

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

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

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

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

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

        @NotNull
        public R examine​(boolean @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • examine

        @NotNull
        public R examine​(byte @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • examine

        @NotNull
        public R examine​(char @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • examine

        @NotNull
        public R examine​(double @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • examine

        @NotNull
        public R examine​(float @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • examine

        @NotNull
        public R examine​(int @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • examine

        @NotNull
        public R examine​(long @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • examine

        @NotNull
        public R examine​(short @Nullable [] values)
        Description copied from interface: Examiner
        Examines.
        Specified by:
        examine in interface Examiner<R>
        Parameters:
        values - the values to examine
        Returns:
        the result
      • array

        @NotNull
        protected abstract R array​(int length,
                                   IntFunction<R> value)
        Examines an array.
        Parameters:
        length - the length of the array
        value - the index to examined value function
        Returns:
        the result from examining the array