/** * Creates a new {@code ModeledCustomHeader} from the value checking that the format is correct. * It may throw if value is not correct */ public H create(final String value) { return parse(value); }
/** * Creates a new {@code ModeledCustomHeader} from the value checking that the format is correct. * It may throw if value is not correct */ public H create(final String value) { return parse(value); }
/** * Creates a new {@code ModeledCustomHeader} from the value checking that the format is correct. * It may throw if value is not correct */ public H create(final String value) { return parse(value); }
/** * Transforms an {@code HttpHeader} to this {@code ModeledCustomHeader} if the name and value are correct. * It may throw in case of malformed headers */ public Optional<H> from(final HttpHeader header) { if (header.lowercaseName().equals(lowercaseName())) { return Optional.of(parse(header.value())); } return Optional.empty(); } }
/** * Transforms an {@code HttpHeader} to this {@code ModeledCustomHeader} if the name and value are correct. * It may throw in case of malformed headers */ public Optional<H> from(final HttpHeader header) { if (header.lowercaseName().equals(lowercaseName())) { return Optional.of(parse(header.value())); } return Optional.empty(); } }
/** * Transforms an {@code HttpHeader} to this {@code ModeledCustomHeader} if the name and value are correct. * It may throw in case of malformed headers */ public Optional<H> from(final HttpHeader header) { if (header.lowercaseName().equals(lowercaseName())) { return Optional.of(parse(header.value())); } return Optional.empty(); } }