class AbstractExtractToAttributesProcessor extends AbstractProcessor {

    protected void setFieldAttribute(Map<String, String> attributes, String attrPrefix, String fieldName, Object data, int index) {
        final String name = getAttributeName(attrPrefix, fieldName, index);

        if (data instanceof byte[]) {
            data = new String((byte[]) data, StandardCharsets.UTF_8);
        }
        if (data instanceof char[]) {
            data = String.valueOf((char[]) data);
        }
        attributes.put(name, Objects.toString(data, ""));
    }

}