in.specmatic.core.NoBodyValue.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of specmatic-core Show documentation
Show all versions of specmatic-core Show documentation
Turn your contracts into executable specifications. Contract Driven Development - Collaboratively Design & Independently Deploy MicroServices & MicroFrontends.
Deprecation Notice for group ID "in.specmatic"
******************************************************************************************************
Updates for "specmatic-core" will no longer be available under the deprecated group ID "in.specmatic".
Please update your dependencies to use the new group ID "io.specmatic".
******************************************************************************************************
package `in`.specmatic.core
import `in`.specmatic.core.pattern.Pattern
import `in`.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
}
}