Interface Instrument.Provider

  • All Known Implementing Classes:
    Drone, RemoteControl
    Enclosing interface:
    Instrument

    public static interface Instrument.Provider
    Interface for an object capable of providing an Instrument.
    • Method Detail

      • getInstrument

        @Nullable
        <I extends Instrument> I getInstrument​(@NonNull
                                               Class<I> instrumentClass)
        Gets an instrument.
        Type Parameters:
        I - type of the instrument class
        Parameters:
        instrumentClass - class of the instrument
        Returns:
        requested instrument, or null if it's not present
      • getInstrument

        @NonNull
        <I extends InstrumentRef<I> getInstrument​(@NonNull
                                                    Class<I> instrumentClass,
                                                    @NonNull
                                                    Ref.Observer<I> observer)
        Gets an instrument and registers an observer notified each time it changes.
        Type Parameters:
        I - type of the instrument class
        Parameters:
        instrumentClass - class of the instrument
        observer - observer to notify when the peripheral changes
        Returns:
        reference to the requested instrument