GeocoderResult

sealed interface GeocoderResult<out T>

Represents the result of a geocoding operation.

Parameters

T

the type of data returned by the geocoding operation.

Inheritors

Types

Link copied to clipboard

Represents a unsuccessful geocoding operation.

Link copied to clipboard

Geocoding operation failed at some point while geocoding.

Link copied to clipboard

This error can occur if the latitude or longitude are out of range, or if the coordinates are not valid coordinates.

Link copied to clipboard

Geocoding failed because the geocoder was unable to get a result for the input.

Link copied to clipboard

Geocoding operation failed because the device does not support geocoding, or the device does not support the specific geocoding operation.

Link copied to clipboard
class Success<T>(val data: List<T>) : GeocoderResult<T>

Represents a successful geocoding operation.

Properties

Link copied to clipboard
open val isError: Boolean

Check if the result was unsuccessful.

Functions

Link copied to clipboard

Get the error or null if the result was successful.

Link copied to clipboard
open fun getFirstOrNull(): T?

Get the first result data or null if the result was unsuccessful.

Link copied to clipboard
open fun getOrNull(): List<T>?

Get the result list data or null if the result was unsuccessful.

Link copied to clipboard

Perform an action if the result was unsuccessful.

Link copied to clipboard
open fun onSuccess(block: (List<T>) -> Unit): GeocoderResult<T>

Perform an action if the result was successful.