PeerDiscoveryConfig

class PeerDiscoveryConfig @InternalWowApi constructor(val type: String, val options: Map<String, String> = emptyMap(), val resources: StoreResources = StoreResources.NONE)

What a PeerDiscovery opens its targets from: its type, its own settings (options, each key relative to wow.peer.<type>, name-template say) and the application's resources.

Fields may be added: the host builds it, so the constructor is internal to Wow; a provider's test builds one with of.

Constructors

Link copied to clipboard
constructor(type: String, options: Map<String, String> = emptyMap(), resources: StoreResources = StoreResources.NONE)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val key: String

The configuration key of the discovery's settings, for a provider's failures to name.

Link copied to clipboard
Link copied to clipboard

The keys of options the discovery asked for, so a test can hold them to the options it declares.

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun option(name: String): String?

The setting name of options, or null when it is not set or blank.

fun <T : Any> option(option: ProviderOption.Defaulted<T>): T

The value of the ProviderOption.Defaulted option: its setting, parsed, else its default, so always one.

fun <T : Any> option(option: ProviderOption<T>): T?

The value of option: its setting in options, parsed, else its default; fails naming the setting when the value is not one of the option's type.

Link copied to clipboard

The settings under the map option (ProviderOption.map), their keys relative to it.

Link copied to clipboard
open override fun toString(): String