/** * @return the {@code DiffEntry} in the form of a readable {@code String} */ @Override public String toString() { StringBuilder sb = new StringBuilder(changeType().toString()); if (!isAdd()) { sb.append(" [").append(oldObject).append("] "); } if (isChange()) { sb.append("->"); } if (!isDelete()) { sb.append(" [").append(newObject).append("]"); } return sb.toString(); }
sb.append(diffEntry.changeType().toString().charAt(0)).append(' ').append(path) .append(LINE_BREAK); for (int i = 0; i < feature.size(); i++) { Optional<Object> value = feature.get(i); sb.append(diffEntry.changeType().toString().charAt(0)); sb.append(' '); sb.append(featureType.descriptors().get(i).getName().toString());
while (diff.hasNext()) { DiffEntry entry = diff.next(); response += entry.changeType().toString() + ","; String fid = ""; if (entry.newPath() != null) {
ChangeType change = next.getChangeType(); out.writeStartArrayElement("Feature"); writeElement("change", change.toString()); writeElement("id", next.getPath()); List<Object> attributes = feature.getAttributes();
DiffEntry entry = entries.next(); out.writeStartArrayElement(name); writeElement("changeType", entry.changeType().toString()); NodeRef oldObject = entry.getOldObject(); NodeRef newObject = entry.getNewObject();
ansi.a("# ").fg(color).a(type.toString().toLowerCase()).a(" ").a(path) .reset(); console.println(ansi.toString());
@Override public void print(GeoGIG geogig, Console console, DiffEntry entry) throws IOException { Ansi ansi = AnsiDecorator.newAnsi(console.isAnsiSupported()); final NodeRef newObject = entry.getNewObject(); final NodeRef oldObject = entry.getOldObject(); String oldMode = shortOid(oldObject == null ? ObjectId.NULL : oldObject.getMetadataId()); String newMode = shortOid(newObject == null ? ObjectId.NULL : newObject.getMetadataId()); String oldId = shortOid(oldObject == null ? ObjectId.NULL : oldObject.getObjectId()); String newId = shortOid(newObject == null ? ObjectId.NULL : newObject.getObjectId()); ansi.a(oldMode).a(" "); ansi.a(newMode).a(" "); ansi.a(oldId).a(" "); ansi.a(newId).a(" "); ansi.fg(entry.changeType() == ADDED ? GREEN : (entry.changeType() == MODIFIED ? YELLOW : RED)); char type = entry.changeType().toString().charAt(0); ansi.a(" ").a(type).reset(); ansi.a(" ").a(formatPath(entry)); console.println(ansi.toString()); }