All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.hiddewieringa.money.convert.ProviderContextExtensions.kt Maven / Gradle / Ivy

The newest version!
package nl.hiddewieringa.money.convert

import javax.money.convert.ProviderContext
import javax.money.convert.ProviderContextBuilder
import javax.money.convert.RateType

/**
 * @see ProviderContextBuilder.of
 */
fun providerContext(context: ProviderContext, init: ProviderContextBuilder.() -> Unit = {}): ProviderContext =
    ProviderContextBuilder
        .create(context)
        .apply(init)
        .build()

/**
 * @see ProviderContextBuilder.of
 */
fun providerContext(provider: String, rateType: RateType, init: ProviderContextBuilder.() -> Unit = {}): ProviderContext =
    ProviderContextBuilder
        .of(provider, rateType)
        .apply(init)
        .build()

/**
 * @see ProviderContextBuilder.of
 */
fun providerContext(provider: String, rateTypes: Collection, init: ProviderContextBuilder.() -> Unit = {}): ProviderContext =
    ProviderContextBuilder
        .of(provider, rateTypes)
        .apply(init)
        .build()




© 2015 - 2025 Weber Informatics LLC | Privacy Policy