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

ru.pocketbyte.locolaser.config.parser.EmptySourceConfigParser.kt Maven / Gradle / Ivy

package ru.pocketbyte.locolaser.config.parser

import ru.pocketbyte.locolaser.config.resources.EmptyResourcesConfig
import ru.pocketbyte.locolaser.exception.InvalidConfigException

class EmptySourceConfigParser : ResourcesConfigParser {

    @Throws(InvalidConfigException::class)
    override fun parse(resourceObject: Any?, throwIfWrongType: Boolean): EmptyResourcesConfig? {
        if (EmptyResourcesConfig.TYPE == resourceObject) {
            return EmptyResourcesConfig()
        }

        if (throwIfWrongType)
            throw InvalidConfigException("Source must equal \"null\"")

        return null
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy