Class DataStoreProvider.ProberList<S,N>

java.lang.Object
org.apache.sis.storage.DataStoreProvider.ProberList<S,N>
Type Parameters:
S - the source type of the original probe.
N - the source type of the next probe to try as an alternative.
All Implemented Interfaces:
DataStoreProvider.Prober<S>
Enclosing class:
DataStoreProvider

private static final class DataStoreProvider.ProberList<S,N> extends Object implements DataStoreProvider.Prober<S>
Implementation of the composed probe returned by DataStoreProvider.Prober.orElse(Class, Prober). Instances of this class a nodes in a linked list.
  • Field Details

  • Constructor Details

  • Method Details

    • test

      public ProbeResult test(S input) throws Exception
      Forward to the primary probe.
      Specified by:
      test in interface DataStoreProvider.Prober<S>
      Parameters:
      input - the input to probe. This is for example a ByteBuffer or a DataInput.
      Returns:
      the result of executing the probe action with the given source. Should not be null.
      Throws:
      Exception - if an error occurred during the execution of the probe action.
    • orElse

      public <A> DataStoreProvider.Prober<S> orElse(Class<A> type, DataStoreProvider.Prober<? super A> prober)
      Appends a new probe alternative at the end of this linked list.
      Specified by:
      orElse in interface DataStoreProvider.Prober<S>
      Type Parameters:
      A - the compile-time type of the type argument (the source or storage type).
      Parameters:
      type - the desired type as one of ByteBuffer, DataInput, etc.
      prober - the test to apply on the source of the given type.
      Returns:
      a composed probe that attempts the given probe if this probe cannot be executed.