Package de.linusdev.lutils.http.header
Interface Header
- All Known Implementing Classes:
HeaderImpl
public interface Header
-
Method Summary
Modifier and TypeMethodDescriptiondefault @NotNull StringasString()This header asString.static booleanChecksgetKey()andgetValue()of both headers and ignores case.@NotNull StringgetKey()Key of thisHeader.@NotNull StringgetValue()Value of thisHeader.static intGenerate the hashcode for aHeaderimplementationstatic @NotNull HeaderCreate newHeader.static @NotNull HeaderCreate newHeader.default <T> TparseValue(@NotNull HeaderValueParser<T> parser) parse this headers value using givenparser
-
Method Details
-
of
Create newHeader.- Parameters:
header- header string with the following format: "key: value"- Returns:
- new
Header.
-
of
Create newHeader.- Parameters:
key- header keyvalue- header value- Returns:
- new
Header
-
getKey
Key of thisHeader.- Returns:
- key as
String
-
getValue
Value of thisHeader.- Returns:
- value as
String
-
parseValue
parse this headers value using givenparser- Type Parameters:
T- class to parse to- Parameters:
parser-HeaderValueParser- Returns:
- parsed header value
- See Also:
-
asString
This header asString.- Returns:
- this header
-
equals
ChecksgetKey()andgetValue()of both headers and ignores case. -
hashCode
Generate the hashcode for aHeaderimplementation- Parameters:
header- theHeaderto generate the hashcode for- Returns:
- hashcode
-