Dubbo and HSF interface parameter reference

更新时间:
复制 MD 格式

The EDAS test engine uses generalized calls to send requests to Dubbo or HSF services. Therefore, you must enter parameters in the format required for generalized calls. This topic describes the parameter types for Dubbo and HSF interfaces and provides examples.

Atomic types, wrapper classes, and string parameters

The atomic type parameters are as follows. Enter the value for each parameter in the specified format.

Type

Value

Example

bool

true or false

true

char

character

a

int

integer

100

long

long integer

101

double

double-precision floating-point number

20.19

java.lang.Integer

integer

100

java.lang.Long

long integer

101

java.lang.Double

double-precision floating-point number

20.19

java.lang.String

string

Hello World

Object type parameters

Object type parameters must be enclosed in braces ({}), and you must set their internal fields.

Type

Example

java.util.HashMap

{

"color": "blue"

"size": 200

}

com.example.User

com.example.User is a custom object type that contains the name and age fields. The following is an example:

{

"name": "Jack",

"age": 12

}

Array and collection type parameters

Array and collection type parameters must be enclosed in square brackets ([]).

Type

Example

java.lang.String[]

["Jack", "Sam", "Jason"]

int[]

[100, 200, 300]

java.util.Map[]

[{"color": "red"}, {"color": "blue"}, {"color": "white"}]

java.util.List<java.lang.String>

["Jack", "Sam", "Jason"]

java.util.Set<java.lang.Integer>

[100, 200, 300]

java.util.Set<com.example.User>

com.example.User is a custom object type that contains the name and age fields. The following is an example:

[

{"name": "Jack", "age": 10},

{"name": "Sam", "age": 12}

]

Interface and abstract type parameters

If the input parameter of a target method is an interface or an abstract type, enclose the parameter value in braces ({}). Inside the braces, use the class field to specify the actual parameter type.

Type

Example

com.example.AbstractUser

The method's input parameter is the abstract class com.example.AbstractUser. Use the class field to specify the actual type.

The following example uses class to specify the actual parameter type as com.example.YoungUser:

{

"name": "Jack",

"age": 12,

"class": "com.example.YoungUser"

}

Enumeration type parameters

Enumeration type parameters must be enclosed in braces ({}), and you must use the name field to specify the value.

Type

Example

Network

  • PUBLIC

  • PRIVATE

The Network enumeration has two values: PUBLIC and PRIVATE. Use the name field to specify the value. For example:

{

"name": "PUBLIC"

}

Date type parameters

Type

Format

Example

  • java.util.Date

  • java.sql.Date

  • java.sql.Timestamp

  • java.sql.Time

yyyy-MM-dd HH:mm:ss

2023-05-17 10:01:19

java.time.LocalDateTime

yyyy-MM-ddTHH:mm:ss

2023-12-03T10:15:30

java.time.LocalDate

yyyy-MM-dd

2023-12-03

java.time.LocalTime

Supports the following two formats:

  • yyyy-MM-ddTHH:mm:ss

  • HH:mm:ss

The following are examples of the two formats:

  • 2023-12-03T10:15:30

  • 10:15:30