<commit_before>package io.scalecube.gateway.clientsdk;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public final class ClientMessage {

  public static final String QUALIFIER = "q";
  private Map<String, String> headers;
  private Object data;

  public ClientMessage(Builder builder) {
    this.headers = new HashMap<>(builder.headers);
    this.data = builder.data;
  }

  public static Builder builder() {
    return new Builder();
  }

  public static Builder from(ClientMessage message) {
    return new Builder(message);
  }

  public String qualifier() {
    return headers.get(QUALIFIER);
  }

  public Map<String, String> headers() {
    return Collections.unmodifiableMap(headers);
  }

  public <T> T data() {
    // noinspection unchecked
    return (T) data;
  }
<commit_msg>Add shortcut method to get header from `ClientMessage`<commit_after>package io.scalecube.gateway.clientsdk;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

public final class ClientMessage {

  public static final String QUALIFIER = "q";
  private Map<String, String> headers;
  private Object data;

  public ClientMessage(Builder builder) {
    this.headers = new HashMap<>(builder.headers);
    this.data = builder.data;
  }

  public static Builder builder() {
    return new Builder();
  }

  public static Builder from(ClientMessage message) {
    return new Builder(message);
  }

  public String qualifier() {
    return headers.get(QUALIFIER);
  }

  public Map<String, String> headers() {
    return Collections.unmodifiableMap(headers);
  }

  public String header(String name) {
    return headers.get(name);
  }

  public <T> T data() {
    // noinspection unchecked
    return (T) data;
  }

{'fraction_non_alphanumeric': 0.10340909090909091, 'fraction_numerical': 0.0, 'mean_word_length': 3.7338709677419355, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2142310', 'n_tokens_mistral': 533, 'n_tokens_neox': 518, 'n_words': 149}