Create a Prefer header representation from a header string
@param value the header value
@return a Prefer object or null on an invalid string
19879
public static Prefer valueOf(final String value) {
        if (nonNull(value)) {
            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());
                }
            });
            final String waitValue = data.get(PREFER_WAIT);
            try {
                Integer wait = null;
                if (nonNull(waitValue)) {
                    wait = parseInt(waitValue);
                }
                return new Prefer(data.get(PREFER_RETURN), parseParameter(data.get(PREFER_INCLUDE)),
                        parseParameter(data.get(PREFER_OMIT)), params, data.get(PREFER_HANDLING), wait);
            } catch (final NumberFormatException ex) {
                LOGGER.error("Cannot parse wait parameter value {}: {}", waitValue, ex.getMessage());
            }
        }
        return null;
    }
1366500
public T header(Header name, String value) {
		return header(name.toString(), value, true);
	}
481321
@Override
    public GetHeadendsResult convert(Map<String, Headend> value) {
        GetHeadendsResult r = new GetHeadendsResult();
        r.setHeadends(value);
        return r;
    }
210364
public Request header(String key, String value) {
        this.headers.put(key, value);
        return this;
    }
184406
public B setHttpHeader(CharSequence name, Object value) {
        requireNonNull(name, "name");
        requireNonNull(value, "value");
        httpHeaders.setObject(HttpHeaderNames.of(name), value);
        return self();
    }
219697
public Request setHeader(String name, String value) {
        this.headers.put(name, value);
        return this;
    }
1353035
protected void header(String name, Object value){
        if(value == null) throw new NullPointerException("value cannot be null");

        header(name, value.toString());
    }
673519
public static AcceptDatetime valueOf(final String value) {
        if (value != null) {
            final Instant time = parseDatetime(value);
            if (time != null) {
                return new AcceptDatetime(time);
            }
        }
        return null;
    }
796891
public static JingleError fromString(String value) {
        if (value != null) {
            value = value.toLowerCase(Locale.US);
            if (value.equals("out-of-order")) {
                return OUT_OF_ORDER;
            } else if (value.equals("unknown-session")) {
                return UNKNOWN_SESSION;
            } else if (value.equals("unsupported-content")) {
                return UNSUPPORTED_CONTENT;
            } else if (value.equals("unsupported-transports")) {
                return UNSUPPORTED_TRANSPORTS;
            } else if (value.equals("unsupported-codecs")) {
                return NO_COMMON_PAYLOAD;
            } else if (value.equals("negotiation-error")) {
                return NEGOTIATION_ERROR;
            } else if (value.equals("malformed-stanza")) {
                return MALFORMED_STANZA;
            }

        }
        return null;
    }
1146150
public HttpClientMockBuilder withHeader(String header, String value) {
        return withHeader(header, equalTo(value));
    }
761568
@Override
    public Boolean fromString(String value) {
        return value != null && TRUE.contains(value.toLowerCase());
    }
760896
public static AcceptDatetime valueOf(final String value) {
        final Optional<Instant> datetime = parseDatetime(value);
        if (datetime.isPresent()) {
            return new AcceptDatetime(datetime.get());
        }
        return null;
    }
689205
@NonNull public CMARichText setValue(@NonNull CharSequence value) {
    if (value == null) {
      throw new NullPointerException("value is null.");
    }
    this.value = value;
    return this;
  }
108403
public String setField(String name, String value)
    {
        if (_state!=__MSG_EDITABLE)
            return null;

        if (HttpFields.__ContentType.equalsIgnoreCase(name))
        {
            String old=_header.get(name);
            setContentType(value);
            return old;
        }
        
        return _header.put(name,value);
    }
335191
public void addHeader(String key, String value) {
        if (key.equals("As-User")) {
            for (int i = 0; i < this.headers.size(); i++) {
                if (this.headers.get(i).getKey().equals("As-User")) {
                    this.headers.remove(i);
                }
            }
        }
        if (key.equals("X-Box-UA")) {
            throw new IllegalArgumentException("Altering the X-Box-UA header is not permitted");
        }
        this.headers.add(new RequestHeader(key, value));
    }
1214123
public HttpClient addHeader(String name, Object value) {
        if (mHeaders == null) {
            mHeaders = new HttpHeaderMap();
        }
        mHeaders.add(name, value);
        return this;
    }
308288
public void setValue(String value) {
		try {			
			ContactHeader contactHeader = (ContactHeader) SipFactoryImpl.headerFactory.createHeader(
					ContactHeader.NAME, value);
			this.address = SipFactoryImpl.addressFactory.createAddress(value);
			this.parameters = getParameters(((Parameters) contactHeader));
		} catch (Exception ex) {
			throw new IllegalArgumentException("Illegal argument", ex);
		}
	}