Package dev.voidframework.web.http
Record Class HttpRequestBodyContent
java.lang.Object
java.lang.Record
dev.voidframework.web.http.HttpRequestBodyContent
- Record Components:
asRaw- The body content as raw
public record HttpRequestBodyContent(String contentType, byte[] asRaw, Map<String,List<FormItem>> asFormData)
extends Record
An Http request body content
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TReturns the body content as a specific object.Returns the value of theasFormDatarecord component.<T> TasFormData(Class<T> outputClass) Returns the form data content body as a specific object.com.fasterxml.jackson.databind.JsonNodeasJson()Returns the JSON content body.byte[]asRaw()Returns the value of theasRawrecord component.asXml()Returns the XML content body.com.fasterxml.jackson.databind.JsonNodeasYaml()Returns the YAML content body.Returns the value of thecontentTyperecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.toString()Returns a string representation of this record class.
-
Constructor Details
-
HttpRequestBodyContent
public HttpRequestBodyContent(String contentType, byte[] asRaw, Map<String, List<FormItem>> asFormData) Creates an instance of aHttpRequestBodyContentrecord class.- Parameters:
contentType- the value for thecontentTyperecord componentasRaw- the value for theasRawrecord componentasFormData- the value for theasFormDatarecord component
-
-
Method Details
-
asFormData
Returns the form data content body as a specific object.- Type Parameters:
T- The requested Java class type- Parameters:
outputClass- The requested Java object type- Returns:
- A Java object
-
asJson
public com.fasterxml.jackson.databind.JsonNode asJson()Returns the JSON content body.- Returns:
- A JSON node
-
as
Returns the body content as a specific object.- Type Parameters:
T- The requested Java class type- Parameters:
outputClass- The requested Java object type- Returns:
- A Java object
-
asXml
Returns the XML content body.- Returns:
- An XML document
-
asYaml
public com.fasterxml.jackson.databind.JsonNode asYaml()Returns the YAML content body.- Returns:
- A YAML node
-
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
asRaw
public byte[] asRaw()Returns the value of theasRawrecord component.- Returns:
- the value of the
asRawrecord component
-
asFormData
Returns the value of theasFormDatarecord component.- Returns:
- the value of the
asFormDatarecord component
-