Package org.atmosphere.cpr
Interface AtmosphereRequestImpl.Body
- All Known Implementing Classes:
AtmosphereRequestImpl.Body.BytesBody,AtmosphereRequestImpl.Body.EmptyBody,AtmosphereRequestImpl.Body.StringBody
- Enclosing class:
AtmosphereRequestImpl
public static sealed interface AtmosphereRequestImpl.Body
permits AtmosphereRequestImpl.Body.StringBody, AtmosphereRequestImpl.Body.BytesBody, AtmosphereRequestImpl.Body.EmptyBody
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordstatic final recordstatic final record -
Method Summary
Modifier and TypeMethodDescriptionbyte[]asBytes()Return the request body as a byte array.asString()Return the request body as a String.intTheasBytes()lengthintTheasBytes()offsetbooleanhasBytes()True is the body is a byte arraybooleanTrue is the body is a StringbooleanisEmpty()True if this object is empty
-
Method Details
-
hasString
boolean hasString()True is the body is a String- Returns:
- True is the body is a String
-
hasBytes
boolean hasBytes()True is the body is a byte array- Returns:
- True is the body is a byte array
-
asString
String asString()Return the request body as a String. If the body was a byte array, this method will return null.- Returns:
- the request body as a String. If the body was a byte array, this method will return null.
-
asBytes
byte[] asBytes()Return the request body as a byte array. If the body was String, this method will return null.- Returns:
- the request body as a byte array. If the body was String, this method will return null.
-
byteOffset
int byteOffset()TheasBytes()offset- Returns:
- The
asBytes()offset
-
byteLength
int byteLength()TheasBytes()length- Returns:
- The
asBytes()length
-
isEmpty
boolean isEmpty()True if this object is empty- Returns:
- True if this object is empty
-