vertx / io.vertx.reactivex.servicediscovery / ServiceReference / cachedAs

# cachedAs

`open fun <X : Any> cachedAs(x: Class<X>): X`

Gets the service object if already retrieved. It won't try to acquire the service object if not retrieved yet. Unlike `io.vertx.reactivex.servicediscovery.ServiceReference#cached`, this method return the warpped object to the desired (given) type.

### Parameters

`x` - the type of object

Return
the object, `null` if not yet retrieved