Skip to content

enum OperationType

cangjie
public enum OperationType <: Equatable<OperationType> & Hashable & IOpenApiSerializable

功能:表示 OpenAPI 操作类型。

父类型:

成员概览

成员功能
Get表示 GET 操作。
Put-
Post-
Delete-
Options-
Head-
Patch-
Trace-
Unkonw-
func ==(OperationType)比较两个操作类型是否相等。
func serializeAsV3(IOpenApiWriter)按 OpenAPI V3 格式写出当前操作类型。
func hashCode()返回当前操作类型的哈希值。
func parse(String)将 HTTP 方法字符串解析为操作类型。
func toString()返回操作类型对应的名称。

Get

cangjie
Get

功能:表示 GET 操作。

Put

cangjie
Put

Post

cangjie
Post

Delete

cangjie
Delete

Options

cangjie
Options

cangjie
Head

Patch

cangjie
Patch

Trace

cangjie
Trace

Unkonw

cangjie
Unkonw

func ==(OperationType)

cangjie
public operator func ==(that: OperationType): Bool

功能:比较两个操作类型是否相等。

参数:

返回值:

  • Bool - 如果两个操作类型相等则返回 true

func serializeAsV3(IOpenApiWriter)

cangjie
public func serializeAsV3(writer: IOpenApiWriter): Unit

功能:按 OpenAPI V3 格式写出当前操作类型。

参数:

返回值:

  • Unit

func hashCode()

cangjie
public func hashCode(): Int64

功能:返回当前操作类型的哈希值。

返回值:

  • Int64 - 当前操作类型的哈希值。

func parse(String)

cangjie
public static func parse(str: String): OperationType

功能:将 HTTP 方法字符串解析为操作类型。

参数:

  • str: String - 要解析的 HTTP 方法字符串。

返回值:

异常:

  • IllegalFormatException - 当字符串不是支持的 HTTP 方法时抛出。

func toString()

cangjie
public func toString(): String

功能:返回操作类型对应的名称。

返回值:

  • String - 当前操作类型对应的名称字符串。