Top Description Methods
io.micrometer.common.docs

public Interface KeyName

Imports
java.util.Arrays, java.util.function.Predicate, io.micrometer.common.KeyValue

Represents a key name used for documenting instrumentation.
Author
Marcin Grzejszczak
Since
1.10.0

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

key name
asString
()

Returns key name.

public default boolean

Returns:

whether this key is required
isRequired
()

Whether this key is required to be present in the instrumentation.

public static KeyName[]

Returns:

a merged array of tag keys
merge
(KeyName[]...
arrays of tag keys
keyNames
)

Merges arrays of tag keys.

public default KeyValue

Returns:

key value
withValue
(String
value for key
value
)

Creates a key value for the given key name.

public default KeyValue

Returns:

key value
withValue
(String
value for key
value
,
Predicate<Object>
value validator
validator
)

Creates a key value for the given key name.

Method Detail

asStringback to summary
public String asString()

Returns key name.

Returns:String

key name

isRequiredback to summary
public default boolean isRequired()

Whether this key is required to be present in the instrumentation. This can be checked in a test of the instrumentation.

Returns:boolean

whether this key is required

mergeback to summary
public static KeyName[] merge(KeyName[]... keyNames)

Merges arrays of tag keys.

Parameters
keyNames:KeyName[][]

arrays of tag keys

Returns:KeyName[]

a merged array of tag keys

withValueback to summary
public default KeyValue withValue(String value)

Creates a key value for the given key name.

Parameters
value:String

value for key

Returns:KeyValue

key value

withValueback to summary
public default KeyValue withValue(String value, Predicate<Object> validator)

Creates a key value for the given key name.

Parameters
value:String

value for key

validator:Predicate<Object>

value validator

Returns:KeyValue

key value