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

de.lancom.openapi.entity.ResponseStatusCode.kt Maven / Gradle / Ivy

Go to download

This open-source project provides an OpenAPI 3.0 Parser implemented in Kotlin, utilizing immutable data classes

There is a newer version: 2.1.1
Show newest version
package de.lancom.openapi.entity

import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.fasterxml.jackson.databind.annotation.JsonSerialize
import de.lancom.openapi.jackson.Key
import de.lancom.openapi.jackson.KeyDeserializer
import de.lancom.openapi.jackson.KeySerializer

@JsonDeserialize(keyUsing = ResponseStatusCode.Companion.Deserializer::class)
@JsonSerialize(keyUsing = ResponseStatusCode.Companion.Serializer::class)
data class ResponseStatusCode(
    val code: String
) : Key {
    override val key: String = code

    constructor(code: Int) : this(code.toString())

    companion object {
        class Deserializer : KeyDeserializer(::ResponseStatusCode)
        class Serializer : KeySerializer(ResponseStatusCode::class.java)

        val DEFAULT = ResponseStatusCode("default")
        val HTTP_200_OK = ResponseStatusCode(200)
        val HTTP_204_NO_CONTENT = ResponseStatusCode(204)
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy