getFacility

fun <F : Facility?> getFacility(@NonNull facilityClass: Class<F>): F

Retrieves a facility.

Return

requested facility, or null if it's not present

Parameters

facilityClass

class of the facility

<F>

type of the facility class

fun <F : Facility?> getFacility(@NonNull facilityClass: Class<F>, @NonNull observer: Ref.Observer<F>): Ref<F>

Retrieves a facility and registers an observer notified each time it changes.

Return

reference to the requested facility

Parameters

facilityClass

class of the facility

observer

observer to notify when the facility changes

<F>

type of the facility class