Record Class RequestBody.SimpleBody
java.lang.Object
java.lang.Record
cloud.opencode.base.web.body.RequestBody.SimpleBody
- All Implemented Interfaces:
RequestBody
- Enclosing interface:
RequestBody
public static record RequestBody.SimpleBody(String contentType, HttpRequest.BodyPublisher publisher, long length)
extends Record
implements RequestBody
- Since:
- JDK 25, opencode-base-web V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Nested Class Summary
Nested classes/interfaces inherited from interface RequestBody
RequestBody.SimpleBody -
Constructor Summary
ConstructorsConstructorDescriptionSimpleBody(String contentType, HttpRequest.BodyPublisher publisher) SimpleBody(String contentType, HttpRequest.BodyPublisher publisher, long length) Creates an instance of aSimpleBodyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecontentTyperecord component.final booleanIndicates whether some other object is "equal to" this one.longfinal inthashCode()Returns a hash code value for this object.longlength()Returns the value of thelengthrecord component.Returns the value of thepublisherrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SimpleBody
-
SimpleBody
Creates an instance of aSimpleBodyrecord class.- Parameters:
contentType- the value for thecontentTyperecord componentpublisher- the value for thepublisherrecord componentlength- the value for thelengthrecord component
-
-
Method Details
-
getContentType
- Specified by:
getContentTypein interfaceRequestBody
-
getBodyPublisher
- Specified by:
getBodyPublisherin interfaceRequestBody
-
getContentLength
public long getContentLength()- Specified by:
getContentLengthin interfaceRequestBody
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
contentType
Returns the value of thecontentTyperecord component.- Returns:
- the value of the
contentTyperecord component
-
publisher
Returns the value of thepublisherrecord component.- Returns:
- the value of the
publisherrecord component
-
length
public long length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-