com.rollbar.notifier.truncation.StringsStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rollbar-java Show documentation
Show all versions of rollbar-java Show documentation
For connecting your applications built on the JVM to Rollbar for Error Reporting
The newest version!
package com.rollbar.notifier.truncation;
import com.rollbar.api.payload.Payload;
class StringsStrategy implements TruncationStrategy {
private final int stringLength;
public StringsStrategy(int stringLength) {
this.stringLength = stringLength;
}
@Override
public TruncationResult truncate(Payload payload) {
if (payload == null || payload.getData() == null) {
return TruncationResult.none();
}
return TruncationResult.truncated(payload.truncateStrings(stringLength));
}
}