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

io.specmatic.core.NoBodyValue.kt Maven / Gradle / Ivy

Go to download

Turn your contracts into executable specifications. Contract Driven Development - Collaboratively Design & Independently Deploy MicroServices & MicroFrontends.

There is a newer version: 2.0.37
Show newest version
package io.specmatic.core

import io.specmatic.core.pattern.Pattern
import io.specmatic.core.value.*

object NoBodyValue : Value {
    override val httpContentType: String
        get() = "text/plain"

    override fun displayableValue(): String {
        return "No body"
    }

    override fun toStringLiteral(): String {
        return ""
    }

    override fun displayableType(): String {
        return "No body"
    }

    override fun exactMatchElseType(): Pattern {
        return NoBodyPattern
    }

    override fun type(): Pattern {
        return NoBodyPattern
    }

    override fun typeDeclarationWithoutKey(
        exampleKey: String,
        types: Map,
        exampleDeclarations: ExampleDeclarations
    ): Pair {
        return TypeDeclaration("No body", types) to exampleDeclarations
    }

    override fun typeDeclarationWithKey(
        key: String,
        types: Map,
        exampleDeclarations: ExampleDeclarations
    ): Pair {
        return TypeDeclaration("No body", types) to exampleDeclarations
    }

    override fun listOf(valueList: List): Value {
        return JSONArrayValue(valueList)
    }

    override fun toString(): String = toStringValue().string

    override fun toStringValue(): StringValue {
        return EmptyString
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy