public class PayloadTruncator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
PayloadTruncator.PayloadTruncationResult |
| Constructor and Description |
|---|
PayloadTruncator(JsonSerializer serializer) |
| Modifier and Type | Method and Description |
|---|---|
static int |
sizeInBytes(java.lang.String payloadJsonString)
The size of the JSON string, as UTF-8 bytes.
|
PayloadTruncator.PayloadTruncationResult |
truncate(com.rollbar.api.payload.Payload payload,
int maxSizeInBytes)
Attempts to truncate the payload so that its JSON representation, encoded as UTF-8, has size
equal or less than the specified maximum size size.
|
public PayloadTruncator(JsonSerializer serializer)
public PayloadTruncator.PayloadTruncationResult truncate(com.rollbar.api.payload.Payload payload, int maxSizeInBytes)
Attempts to truncate the payload so that its JSON representation, encoded as UTF-8, has size equal or less than the specified maximum size size.
payload - The payload to be truncated.maxSizeInBytes - The maximum size, in bytes, for the payload.public static int sizeInBytes(java.lang.String payloadJsonString)
payloadJsonString - The string to measure.