com.exasol.adapter.document.mapping.ExcerptGenerator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of virtual-schema-common-document Show documentation
Show all versions of virtual-schema-common-document Show documentation
Common module of Exasol Virtual Schema Adapters for Document Data Sources.
The newest version!
package com.exasol.adapter.document.mapping;
/**
* This class generates an excerpt of a string.
*/
public class ExcerptGenerator {
/**
* Get an excerpt of a string value for error reporting.
*
* @param value string value
* @return excerpt if string was longer than 50 chars. Otherwise the original string.
*/
public static String getExcerpt(final String value) {
if (value.length() > 50) {
return value.substring(0, 50) + "...";
} else {
return value;
}
}
private ExcerptGenerator() {
// empty on purpose
}
}