Record Class ForwardedHeaderUtils.ForwardedInfo

java.lang.Object
java.lang.Record
org.springframework.web.util.ForwardedHeaderUtils.ForwardedInfo
Record Components:
uriComponentsBuilder - the request URI adapted with the scheme, host, and port from forwarded header values
forAddress - the address parsed from the "Forwarded" header "for" or "X-Forwarded-For" value, representing the client, or null if not present
byAddress - the address parsed from the "Forwarded" header "by", representing the server, or null if not present; always null when returned from ForwardedHeaderUtils.parseXForwardedHeaders(URI, HttpHeaders, InetSocketAddress, InetSocketAddress)
Enclosing class:
ForwardedHeaderUtils

public static record ForwardedHeaderUtils.ForwardedInfo(UriComponentsBuilder uriComponentsBuilder, @Nullable InetSocketAddress forAddress, @Nullable InetSocketAddress byAddress) extends Record
Container for the combined results of parsing either the "Forwarded" header or the "X-Forwarded-*" alternative headers.
Since:
6.1.29
Author:
Rossen Stoyanchev
  • Constructor Details

  • Method Details

    • uri

      public URI uri()
      Return a URI initialized from uriComponentsBuilder().
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • uriComponentsBuilder

      public UriComponentsBuilder uriComponentsBuilder()
      Returns the value of the uriComponentsBuilder record component.
      Returns:
      the value of the uriComponentsBuilder record component
    • forAddress

      public @Nullable InetSocketAddress forAddress()
      Returns the value of the forAddress record component.
      Returns:
      the value of the forAddress record component
    • byAddress

      public @Nullable InetSocketAddress byAddress()
      Returns the value of the byAddress record component.
      Returns:
      the value of the byAddress record component