Interface Instrument.Provider
-
- All Known Implementing Classes:
Drone
,RemoteControl
- Enclosing interface:
- Instrument
public static interface Instrument.Provider
Interface for an object capable of providing anInstrument
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <I extends Instrument>
IgetInstrument(Class<I> instrumentClass)
Gets an instrument.<I extends Instrument>
Ref<I>getInstrument(Class<I> instrumentClass, Ref.Observer<I> observer)
Gets an instrument and registers an observer notified each time it changes.
-
-
-
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 Instrument> Ref<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 instrumentobserver
- observer to notify when the peripheral changes- Returns:
- reference to the requested instrument
-
-