vertx / io.vertx.servicediscovery.types / AbstractServiceReference / getAs

# getAs

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

Gets the service object. It can be a proxy, a client or whatever object depending on the service type. Unlike `#get()` this method let you configure the type of object you want to retrieve. This parameter must match the expected service type, and must pass the "polyglot" version of the class.

### Parameters

`x` - the

Return
the object to access the service