Record Class ClientAddressResolver.ForwardedHeaders
java.lang.Object
java.lang.Record
com.iizix.server.geo.ip2location.ClientAddressResolver.ForwardedHeaders
- Record Components:
forwarded- TheForwardedheader values, never null.xForwardedFor- TheX-Forwarded-Forheader values, never null.
- Enclosing class:
ClientAddressResolver
Field Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionForwardedHeaders(List<String> forwarded, List<String> xForwardedFor) Creates an instance of aForwardedHeadersrecord class.Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theforwardedrecord component.Extracts the two headers from the header map of an upgrade request; header names are matched case-insensitively because the map carries them as sent.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Returns if no header is present.final StringtoString()Returns a string representation of this record class.Returns the value of thexForwardedForrecord component.
Field Details
EMPTY
Empty headers.
Constructor Details
ForwardedHeaders
Method Details
from
Extracts the two headers from the header map of an upgrade request; header names are matched case-insensitively because the map carries them as sent.- Parameters:
headerFields- The header map, null for none.- Returns:
- The headers,
EMPTYwhen none is present.
isEmpty
public boolean isEmpty()Returns if no header is present.- Returns:
- true when both lists are empty.
toString
hashCode
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object).forwarded
xForwardedFor
Returns the value of thexForwardedForrecord component.- Returns:
- the value of the
xForwardedForrecord component