# ProtocolVersionMigrationEnvironment

abstract class ProtocolVersionMigrationEnvironment(val protocolName: String) : ServerClientMigrationEnvironment

Defines migrations based on concrete protocol version.

#### See also

pl.novelpay.client.sdk.communication.migration.ProtocolVersionMigrationEnvironmentImpl

## Constructors

ProtocolVersionMigrationEnvironment
Link copied to clipboard
constructor(protocolName: String)

## Properties

protocolName
Link copied to clipboard
val protocolName: String

is name of protocol whose version should be checked in order to perform migration properly. It should only use values of pl.novelpay.aidl.kotlin.model.ProtocolName enum type which is out of scope of this module

## Functions

forExactVersion
Link copied to clipboard
fun <ReturnType> forExactVersion(version: String, migration: () -> ReturnType)

Performs migration only for one specific version

forVersions
Link copied to clipboard
fun <ReturnType> forVersions(vararg versions: String, migration: (String) -> ReturnType): ReturnType?
getVersion
Link copied to clipboard
abstract fun getVersion(): String?
notForVersions
Link copied to clipboard
fun <ReturnType> notForVersions(vararg versions: String, migration: (String) -> ReturnType): ReturnType?

Performs migration for all the versions except versions