java.lang.Object
java.lang.Record
com.renomad.minum.web.StatusLine
public record StatusLine(StatusLine.StatusCode status, HttpVersion version, String rawValue)
extends Record
This class represents the text that is sent back in a
Response
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionStatusLine
(StatusLine.StatusCode status, HttpVersion version, String rawValue) Creates an instance of aStatusLine
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.static StatusLine
extractStatusLine
(String value) Parses a string value of a status line from an HTTP server.final int
hashCode()
Returns a hash code value for this object.rawValue()
Returns the value of therawValue
record component.status()
Returns the value of thestatus
record component.final String
toString()
Returns a string representation of this record class.version()
Returns the value of theversion
record component.
-
Constructor Details
-
StatusLine
Creates an instance of aStatusLine
record class.- Parameters:
status
- the value for thestatus
record componentversion
- the value for theversion
record componentrawValue
- the value for therawValue
record component
-
-
Method Details
-
extractStatusLine
Parses a string value of a status line from an HTTP server. If the input value is null or empty, we'll return aStatusLine
with null-object values -
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. -
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. -
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)
. -
status
Returns the value of thestatus
record component.- Returns:
- the value of the
status
record component
-
version
Returns the value of theversion
record component.- Returns:
- the value of the
version
record component
-
rawValue
Returns the value of therawValue
record component.- Returns:
- the value of the
rawValue
record component
-