Create a Prefer header representation from a header string.

@param value the header value
@return a Prefer object or null on an invalid string
974425
public static Prefer valueOf(final String value) {
        if (value != null) {
            final Map<String, String> data = new HashMap<>();
            final Set<String> params = new HashSet<>();
            stream(value.split(";")).map(String::trim).map(pref -> pref.split("=", 2)).forEach(x -> {
                if (x.length == 2) {
                    data.put(x[0].trim(), x[1].trim());
                } else {
                    params.add(x[0].trim());
                }
            });
            return new Prefer(data.get(PREFER_RETURN), parseParameter(data.get(PREFER_INCLUDE)),
                        parseParameter(data.get(PREFER_OMIT)), params, data.get(PREFER_HANDLING));
        }
        return null;
    }
689205
@NonNull public CMARichText setValue(@NonNull CharSequence value) {
    if (value == null) {
      throw new NullPointerException("value is null.");
    }
    this.value = value;
    return this;
  }
564697
public static MediaType fromString(String value) {
        if (value == null) {
            throw new NullPointerException("value");
        }
        List<ParameterizedHeaderWithValue> headerValues = ParameterizedHeaderWithValue.fromString(value);
        if (headerValues.isEmpty()) {
            throw new IllegalArgumentException("The value '" + value + "' did not contain a valid header value");
        }
        ParameterizedHeaderWithValue v = headerValues.get(0);
        String[] split = v.value().split("/");
        if (split.length != 2) {
            throw new IllegalArgumentException("Media types must be in the format 'type/subtype'; this is inavlid: '" + v.value() + "'");
        }
        return new MediaType(split[0], split[1], v.parameters());
    }
558980
private String firstUpper(String value) {
        return value == null ? null : value.substring(0, 1).toUpperCase() + value.substring(1);
    }
120561
public T queryString(String name, String value) {
        List<String> l = queryString.get(name);
        if (l == null) {
            l = new ArrayList<String>();
        }
        l.add(value);
        queryString.put(name, l);
        return derived.cast(this);
    }
1343253
public static Slug valueOf(final String value) {
        if (value != null) {
            final String decoded = decodeSlug(value);
            if (decoded != null) {
                return new Slug(decoded);
            }
        }
        return null;
    }
446222
public void add(HttpHeader header, String value) {
        if (value == null)
            throw new IllegalArgumentException("null value");

        HttpField field = new HttpField(header, value);
        add(field);
    }
1364596
public final B setHeader(CharSequence name, Object value) {
        requireNonNull(name, "name");
        requireNonNull(value, "value");
        getOrCreateHeaders().setObject(HttpHeaderNames.of(name), value);
        return self();
    }
692581
public HeaderParams put(String name, String value) {
        values.put(cleanAndValidate(name), cleanAndValidate(value));
        return this;
    }
721019
public String set(String value)
    {
        String prevValue = setString(value);
        if (prevValue == null) {
            prevValue = getDefaultValue();
        }
        return prevValue;
    }
1288352
public Map<String, String> addRequestHeader(String key, String value) {
    this.requestHeaders.put(key, value);
    return getRequestHeaders();
  }
1217330
public function header($name, $value = null)
    {

        if ($value === null) {
            $this->headers[] = $name;
        } else {
            $this->headers[] = $this->headerString($name, $value);
        }

        return $this;
    }
1020049
public PactDslJsonArray stringValue(String value) {
      if (value == null) {
        body.put(JSONObject.NULL);
      } else {
        body.put(value);
      }
      return this;
    }
1366500
public T header(Header name, String value) {
		return header(name.toString(), value, true);
	}
972103
public HttpHubConnectionBuilder withHeader(String name, String value) {
        if (headers == null) {
            this.headers = new HashMap<>();
        }
        this.headers.put(name, value);
        return this;
    }
396651
public static Header of(String name, String value) {
        return new Header(requireNonNull(name), requireNonNull(value));
    }
1080829
public T header(String name, Object value) {
        getMessageContentBuilder().getMessageHeaders().put(name, value);
        return self;
    }