CallerContext.Builder (Apache Hadoop Common 3.5.0 API)
Description: declaration: package: org.apache.hadoop.ipc, class: CallerContext, class: Builder

Package org.apache.hadoop.ipc

# Class CallerContext.Builder

java.lang.Object
org.apache.hadoop.ipc.CallerContext.Builder

Enclosing class:
  CallerContext

public static final class CallerContext.Builder extends Object
The caller context builder.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `KEY_VALUE_SEPARATOR`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Builder(String context)`
  `Builder(String context, String separator)`
  `Builder(String context, Configuration conf)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `CallerContext.Builder`
  `append(String field)`
  Append new field to the context.
  `CallerContext.Builder`
  `append(String key, String value)`
  Append new field which contains key and value to the context.
  `CallerContext.Builder`
  `appendIfAbsent(String key, String value)`
  Append new field which contains key and value to the context if the key("key:") is absent.
  `CallerContext`
  `build()`
  `String`
  `getContext()`
  Get the context.
  `byte[]`
  `getSignature()`
  Get the signature.
  `CallerContext.Builder`
  `setSignature(byte[] signature)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### KEY_VALUE_SEPARATOR

    public static final String KEY_VALUE_SEPARATOR
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### Builder

    public Builder(String context)

  - ### Builder

    public Builder(String context, Configuration conf)

  - ### Builder

    public Builder(String context, String separator)

- ## Method Details

  - ### setSignature

    public CallerContext.Builder setSignature(byte[] signature)

  - ### getContext

    public String getContext()
    Get the context. For example, the context is "key1:value1,key2:value2".
    Returns:
      the valid context or null.

  - ### getSignature

    public byte[] getSignature()
    Get the signature.
    Returns:
      the signature.

  - ### append

    public CallerContext.Builder append(String field)
    Append new field to the context.
    Parameters:
      `field` - one of fields to append.
    Returns:
      the builder.

  - ### append

    public CallerContext.Builder append(String key, String value)
    Append new field which contains key and value to the context.
    Parameters:
      `key` - the key of field.
      `value` - the value of field.
    Returns:
      the builder.

  - ### appendIfAbsent

    public CallerContext.Builder appendIfAbsent(String key, String value)
    Append new field which contains key and value to the context if the key("key:") is absent.
    Parameters:
      `key` - the key of field.
      `value` - the value of field.
    Returns:
      the builder.

  - ### build

    public CallerContext build()