Interface KeyName


public interface KeyName
Represents a key name used for documenting instrumentation.
Since:
1.10.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns key name.
    default boolean
    Whether this key is required to be present in the instrumentation.
    static KeyName[]
    merge(KeyName[]... keyNames)
    Merges arrays of tag keys.
    default KeyValue
    Creates a key value for the given key name.
    default KeyValue
    withValue(String value, Predicate<Object> validator)
    Creates a key value for the given key name.
  • Method Details

    • merge

      static KeyName[] merge(KeyName[]... keyNames)
      Merges arrays of tag keys.
      Parameters:
      keyNames - arrays of tag keys
      Returns:
      a merged array of tag keys
    • withValue

      default KeyValue withValue(String value)
      Creates a key value for the given key name.
      Parameters:
      value - value for key
      Returns:
      key value
    • withValue

      default KeyValue withValue(String value, Predicate<Object> validator)
      Creates a key value for the given key name.
      Parameters:
      value - value for key
      validator - value validator
      Returns:
      key value
    • asString

      String asString()
      Returns key name.
      Returns:
      key name
    • isRequired

      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:
      whether this key is required