Record Class MultiValueHeaders

java.lang.Object
java.lang.Record
io.micronaut.http.poja.util.MultiValueHeaders
Record Components:
headers - The values
All Implemented Interfaces:
io.micronaut.core.convert.ConversionServiceAware, io.micronaut.core.convert.ConversionServiceProvider, io.micronaut.core.convert.value.ConvertibleMultiValues<String>, io.micronaut.core.convert.value.ConvertibleValues<List<String>>, io.micronaut.core.type.Headers, io.micronaut.core.type.MutableHeaders, io.micronaut.core.value.ValueResolver<CharSequence>, io.micronaut.http.HttpHeaders, io.micronaut.http.MutableHttpHeaders, Iterable<Map.Entry<String,List<String>>>

public record MultiValueHeaders(io.micronaut.core.convert.value.MutableConvertibleMultiValuesMap<String> headers) extends Record implements io.micronaut.http.MutableHttpHeaders
Headers implementation based on a multi-value map. The implementation performs the header's standardization.
  • Field Summary

    Fields inherited from interface io.micronaut.core.convert.value.ConvertibleValues

    EMPTY

    Fields inherited from interface io.micronaut.http.HttpHeaders

    ACCEPT, ACCEPT_CH, ACCEPT_CH_LIFETIME, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ACCEPT_PATCH, ACCEPT_RANGES, ACCESS_CONTROL_ALLOW_CREDENTIALS, ACCESS_CONTROL_ALLOW_HEADERS, ACCESS_CONTROL_ALLOW_METHODS, ACCESS_CONTROL_ALLOW_ORIGIN, ACCESS_CONTROL_ALLOW_PRIVATE_NETWORK, ACCESS_CONTROL_EXPOSE_HEADERS, ACCESS_CONTROL_MAX_AGE, ACCESS_CONTROL_REQUEST_HEADERS, ACCESS_CONTROL_REQUEST_METHOD, ACCESS_CONTROL_REQUEST_PRIVATE_NETWORK, AGE, ALLOW, AUTHORIZATION, AUTHORIZATION_INFO, CACHE_CONTROL, CONNECTION, CONTENT_BASE, CONTENT_DISPOSITION, CONTENT_DPR, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_MD5, CONTENT_RANGE, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, COOKIE, CROSS_ORIGIN_RESOURCE_POLICY, DATE, DEVICE_MEMORY, DOWNLINK, DPR, ECT, ETAG, EXPECT, EXPIRES, FEATURE_POLICY, FORWARDED, FROM, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_RANGE, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LINK, LOCATION, MAX_FORWARDS, ORIGIN, PRAGMA, PROXY_AUTHENTICATE, PROXY_AUTHORIZATION, RANGE, REFERER, REFERRER_POLICY, RETRY_AFTER, RTT, SAVE_DATA, SEC_WEBSOCKET_ACCEPT, SEC_WEBSOCKET_KEY, SEC_WEBSOCKET_KEY1, SEC_WEBSOCKET_KEY2, SEC_WEBSOCKET_LOCATION, SEC_WEBSOCKET_ORIGIN, SEC_WEBSOCKET_PROTOCOL, SEC_WEBSOCKET_VERSION, SERVER, SET_COOKIE, SET_COOKIE2, SOURCE_MAP, STANDARD_HEADERS, TE, TRAILER, TRANSFER_ENCODING, UPGRADE, USER_AGENT, VARY, VIA, VIEWPORT_WIDTH, WARNING, WEBSOCKET_LOCATION, WEBSOCKET_ORIGIN, WEBSOCKET_PROTOCOL, WIDTH, WWW_AUTHENTICATE, X_AUTH_TOKEN

    Fields inherited from interface io.micronaut.http.MutableHttpHeaders

    GMT
  • Constructor Summary

    Constructors
    Constructor
    Description
    MultiValueHeaders(io.micronaut.core.convert.value.MutableConvertibleMultiValuesMap<String> headers)
    Creates an instance of a MultiValueHeaders record class.
    MultiValueHeaders(Map<String,List<String>> headers, io.micronaut.core.convert.ConversionService conversionService)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.http.MutableHttpHeaders
    add(CharSequence header, CharSequence value)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    @Nullable String
     
    <T> Optional<T>
    get(CharSequence name, io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext)
     
     
    final int
    Returns a hash code value for this object.
    io.micronaut.core.convert.value.MutableConvertibleMultiValuesMap<String>
    Returns the value of the headers record component.
     
    io.micronaut.http.MutableHttpHeaders
     
    void
    setConversionService(@NonNull io.micronaut.core.convert.ConversionService conversionService)
     
    final String
    Returns a string representation of this record class.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.micronaut.core.convert.value.ConvertibleMultiValues

    forEach, forEachValue, getFirst, getFirst, getFirst, getFirst, getFirst, isEmpty, iterator

    Methods inherited from interface io.micronaut.core.convert.value.ConvertibleValues

    asMap, asMap, asProperties, contains, getConversionService, getValue, getValueType, subMap, subMap, subMap

    Methods inherited from interface io.micronaut.http.HttpHeaders

    accept, acceptCharset, acceptLanguage, contentLength, contentType, findAcceptCharset, findAcceptLanguage, findDate, findFirst, findInt, getAuthorization, getContentType, getDate, getInt, getOrigin, isKeepAlive

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface io.micronaut.core.type.MutableHeaders

    setIfMissing

    Methods inherited from interface io.micronaut.http.MutableHttpHeaders

    add, add, allow, allow, allowGeneric, auth, auth, contentType, date, date, expires, expires, ifModifiedSince, ifModifiedSince, lastModified, lastModified, location, set

    Methods inherited from interface io.micronaut.core.value.ValueResolver

    get, get, get
  • Constructor Details

    • MultiValueHeaders

      public MultiValueHeaders(Map<String,List<String>> headers, io.micronaut.core.convert.ConversionService conversionService)
    • MultiValueHeaders

      public MultiValueHeaders(io.micronaut.core.convert.value.MutableConvertibleMultiValuesMap<String> headers)
      Creates an instance of a MultiValueHeaders record class.
      Parameters:
      headers - the value for the headers record component
  • Method Details

    • getAll

      public List<String> getAll(CharSequence name)
      Specified by:
      getAll in interface io.micronaut.core.convert.value.ConvertibleMultiValues<String>
    • get

      @Nullable public @Nullable String get(CharSequence name)
      Specified by:
      get in interface io.micronaut.core.convert.value.ConvertibleMultiValues<String>
    • names

      public Set<String> names()
      Specified by:
      names in interface io.micronaut.core.convert.value.ConvertibleValues<List<String>>
    • values

      public Collection<List<String>> values()
      Specified by:
      values in interface io.micronaut.core.convert.value.ConvertibleValues<List<String>>
    • get

      public <T> Optional<T> get(CharSequence name, io.micronaut.core.convert.ArgumentConversionContext<T> conversionContext)
      Specified by:
      get in interface io.micronaut.core.value.ValueResolver<CharSequence>
    • add

      public io.micronaut.http.MutableHttpHeaders add(CharSequence header, CharSequence value)
      Specified by:
      add in interface io.micronaut.core.type.MutableHeaders
      Specified by:
      add in interface io.micronaut.http.MutableHttpHeaders
    • remove

      public io.micronaut.http.MutableHttpHeaders remove(CharSequence header)
      Specified by:
      remove in interface io.micronaut.core.type.MutableHeaders
      Specified by:
      remove in interface io.micronaut.http.MutableHttpHeaders
    • setConversionService

      public void setConversionService(@NonNull @NonNull io.micronaut.core.convert.ConversionService conversionService)
      Specified by:
      setConversionService in interface io.micronaut.core.convert.ConversionServiceAware
    • 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.
    • headers

      public io.micronaut.core.convert.value.MutableConvertibleMultiValuesMap<String> headers()
      Returns the value of the headers record component.
      Returns:
      the value of the headers record component