Skip to content

Instantly share code, notes, and snippets.

@jurasseck
Created July 13, 2015 13:15
Show Gist options
  • Save jurasseck/552460b7315e6d554db1 to your computer and use it in GitHub Desktop.
Save jurasseck/552460b7315e6d554db1 to your computer and use it in GitHub Desktop.
public String getIntegrationHeader() {
StringBuilder header = new StringBuilder();
for (Field field : getClass().getDeclaredFields()) {
if (field.isAnnotationPresent(IntegraTalisma.class)) {
header.append(field.getName()).append(FIELD_SEPARATOR);
}
}
return header.toString().substring(0, header.length() - 1) + QUEBRA_LINHA;
}
public String getIntegrationContent() throws IllegalArgumentException, IllegalAccessException {
StringBuilder content = new StringBuilder();
for (Field field : getClass().getDeclaredFields()) {
if (field.isAnnotationPresent(IntegraTalisma.class)) {
field.setAccessible(true);
content.append((Object) field.get(this)).append(FIELD_SEPARATOR);
}
}
return content.toString().substring(0, content.length() - 1) + QUEBRA_LINHA;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment