commonMain.dk.cachet.carp.common.application.sampling.NoOptionsSampling.kt Maven / Gradle / Ivy
Go to download
Helper classes and base types relied upon by all subsystems. This library does not contain any domain logic.
The newest version!
package dk.cachet.carp.common.application.sampling
import dk.cachet.carp.common.application.data.DataTypeMetaData
import kotlinx.serialization.*
import kotlin.js.JsExport
/**
* Sampling scheme which does not allow any sampling configuration.
*/
@JsExport
class NoOptionsSamplingScheme( dataType: DataTypeMetaData ) :
DataTypeSamplingScheme( dataType, NoOptionsSamplingConfiguration )
{
override fun createSamplingConfigurationBuilder(): NoOptionsSamplingConfigurationBuilder =
NoOptionsSamplingConfigurationBuilder
override fun isValid( configuration: SamplingConfiguration ) = configuration is NoOptionsSamplingConfiguration
}
/**
* A sampling configuration which does not provide any configuration options.
*/
@Serializable
@JsExport
object NoOptionsSamplingConfiguration : SamplingConfiguration
/**
* A [SamplingConfiguration] builder for [DataTypeSamplingScheme]s which cannot be configured.
*/
@JsExport
object NoOptionsSamplingConfigurationBuilder : SamplingConfigurationBuilder
{
override fun build(): NoOptionsSamplingConfiguration = NoOptionsSamplingConfiguration
}