Record Class SecFetch

java.lang.Object
java.lang.Record
io.micronaut.http.SecFetch
Record Components:
site - The relationship between the request initiator and requested resource
mode - The request mode
dest - The request destination
user - Whether the request was initiated by user activation

public record SecFetch(Site site, Mode mode, Destination dest, boolean user) extends Record
The Fetch Metadata request headers.
Since:
5.1.12
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    SecFetch(Site site, Mode mode, Destination dest, boolean user)
    Creates an instance of a SecFetch record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the dest record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    Returns the value of the mode record component.
    static @Nullable SecFetch
    of(HttpHeaders headers)
    Creates Fetch Metadata from the given headers.
    static @Nullable SecFetch
    of(HttpRequest<?> request)
    Creates Fetch Metadata from the request headers.
    Returns the value of the site record component.
    final String
    Returns a string representation of this record class.
    boolean
    Returns the value of the user record component.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SecFetch

      public SecFetch(Site site, Mode mode, Destination dest, boolean user)
      Creates an instance of a SecFetch record class.
      Parameters:
      site - the value for the site record component
      mode - the value for the mode record component
      dest - the value for the dest record component
      user - the value for the user record component
  • Method Details

    • of

      public static @Nullable SecFetch of(HttpRequest<?> request)
      Creates Fetch Metadata from the request headers.
      Parameters:
      request - The HTTP request
      Returns:
      The Fetch Metadata, or null if the request does not contain all recognized Fetch Metadata headers
      Since:
      5.1.12
    • of

      public static @Nullable SecFetch of(HttpHeaders headers)
      Creates Fetch Metadata from the given headers.
      Parameters:
      headers - The HTTP headers
      Returns:
      The Fetch Metadata, or null if the headers do not contain all recognized Fetch Metadata headers
      Since:
      5.1.12
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • site

      public Site site()
      Returns the value of the site record component.
      Returns:
      the value of the site record component
    • mode

      public Mode mode()
      Returns the value of the mode record component.
      Returns:
      the value of the mode record component
    • dest

      public Destination dest()
      Returns the value of the dest record component.
      Returns:
      the value of the dest record component
    • user

      public boolean user()
      Returns the value of the user record component.
      Returns:
      the value of the user record component