public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case TYPE: return getType(); case CONTENT: return getContent(); } throw new IllegalStateException(); }
public Object getFieldValue(_Fields field) { switch (field) { case PATH: return getPath(); case TYPE: return getType(); case CONTENT: return getContent(); } throw new IllegalStateException(); }
@Override public CompletableFuture<Map<String, EntryType>> listFiles(String projectName, String repositoryName, Revision revision, String pathPattern) { final CompletableFuture<List<com.linecorp.centraldogma.internal.thrift.Entry>> future = run(callback -> client.listFiles(projectName, repositoryName, RevisionConverter.TO_DATA.convert(revision), pathPattern, callback)); return future.thenApply(list -> list.stream().collect(toImmutableMap( com.linecorp.centraldogma.internal.thrift.Entry::getPath, e -> EntryConverter.convertEntryType(e.getType())))); }
@Override public CompletableFuture<Map<String, EntryType>> listFiles(String projectName, String repositoryName, Revision revision, String pathPattern) { final CompletableFuture<List<com.linecorp.centraldogma.internal.thrift.Entry>> future = run(callback -> client.listFiles(projectName, repositoryName, RevisionConverter.TO_DATA.convert(revision), pathPattern, callback)); return future.thenApply(list -> list.stream().collect(toImmutableMap( com.linecorp.centraldogma.internal.thrift.Entry::getPath, e -> EntryConverter.convertEntryType(e.getType())))); }
@Override public CompletableFuture<Map<String, EntryType>> listFiles(String projectName, String repositoryName, Revision revision, String pathPattern) { final CompletableFuture<List<com.linecorp.centraldogma.internal.thrift.Entry>> future = run(callback -> client.listFiles(projectName, repositoryName, RevisionConverter.TO_DATA.convert(revision), pathPattern, callback)); return future.thenApply(list -> list.stream().collect(toImmutableMap( com.linecorp.centraldogma.internal.thrift.Entry::getPath, e -> EntryConverter.convertEntryType(e.getType())))); }
public static com.linecorp.centraldogma.common.Entry<?> convert( com.linecorp.centraldogma.common.Revision revision, Entry entry) { switch (entry.getType()) { case JSON: try { final JsonNode value = Jackson.readTree(entry.getContent()); return com.linecorp.centraldogma.common.Entry.ofJson(revision, entry.getPath(), value); } catch (IOException e) { throw new UncheckedIOException(e); } case TEXT: return com.linecorp.centraldogma.common.Entry.ofText(revision, entry.getPath(), entry.getContent()); case DIRECTORY: return com.linecorp.centraldogma.common.Entry.ofDirectory(revision, entry.getPath()); default: throw new IllegalArgumentException("unsupported entry type: " + entry.getType()); } }
public static com.linecorp.centraldogma.common.Entry<?> convert( com.linecorp.centraldogma.common.Revision revision, Entry entry) { switch (entry.getType()) { case JSON: try { final JsonNode value = Jackson.readTree(entry.getContent()); return com.linecorp.centraldogma.common.Entry.ofJson(revision, entry.getPath(), value); } catch (IOException e) { throw new UncheckedIOException(e); } case TEXT: return com.linecorp.centraldogma.common.Entry.ofText(revision, entry.getPath(), entry.getContent()); case DIRECTORY: return com.linecorp.centraldogma.common.Entry.ofDirectory(revision, entry.getPath()); default: throw new IllegalArgumentException("unsupported entry type: " + entry.getType()); } }