Class ArrayBasedTraceStateBuilder

    • Constructor Detail

      • ArrayBasedTraceStateBuilder

        ArrayBasedTraceStateBuilder()
    • Method Detail

      • put

        public TraceStateBuilder put​(java.lang.String key,
                                     java.lang.String value)
        Allows key value pairs to be added to the TraceState.
        Specified by:
        put in interface TraceStateBuilder
        Parameters:
        key - is an opaque string up to 256 characters printable. It MUST begin with a lowercase letter, and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and forward slashes /. For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name. The tenant id (before the '@') is limited to 240 characters and the vendor id is limited to 13 characters. If in the multi-tenant vendor format, then the first character may additionally be numeric.
        value - the value for the Entry to be added.
        Returns:
        this.
      • remove

        public TraceStateBuilder remove​(java.lang.String key)
        Description copied from interface: TraceStateBuilder
        Removes the Entry that has the given key if it is present.
        Specified by:
        remove in interface TraceStateBuilder
        Parameters:
        key - the key for the Entry to be removed.
        Returns:
        this.
      • build

        public TraceState build()
        Description copied from interface: TraceStateBuilder
        Builds a TraceState by adding the entries to the parent in front of the key-value pairs list and removing duplicate entries.
        Specified by:
        build in interface TraceStateBuilder
        Returns:
        a TraceState with the new entries.
      • isKeyValid

        private static boolean isKeyValid​(@Nullable
                                          java.lang.String key)
        Checks the validity of a key.
        Parameters:
        key - is an opaque string up to 256 characters printable. It MUST begin with a lowercase letter, and can only contain lowercase letters a-z, digits 0-9, underscores _, dashes -, asterisks *, and forward slashes /. For multi-tenant vendor scenarios, an at sign (@) can be used to prefix the vendor name. The tenant id (before the '@') is limited to 240 characters and the vendor id is limited to 13 characters. If in the multi-tenant vendor format, then the first character may additionally be numeric.
        Returns:
        boolean representing key validity
      • isNotLegalKeyCharacter

        private static boolean isNotLegalKeyCharacter​(char c)
      • isNotLowercaseLetterOrDigit

        private static boolean isNotLowercaseLetterOrDigit​(char ch)
      • isNotDigit

        private static boolean isNotDigit​(char ch)
      • isValueValid

        private static boolean isValueValid​(@Nullable
                                            java.lang.String value)