use of org.neo4j.server.rest.repr.ListRepresentation in project neo4j by neo4j.
the class DatabaseActions method getSchemaIndexes.
public ListRepresentation getSchemaIndexes(String labelName) {
Iterable<IndexDefinition> definitions = graphDb.schema().getIndexes(label(labelName));
Iterable<IndexDefinitionRepresentation> representations = map(new Function<IndexDefinition, IndexDefinitionRepresentation>() {
@Override
public IndexDefinitionRepresentation apply(IndexDefinition definition) {
return new IndexDefinitionRepresentation(definition, graphDb.schema().getIndexState(definition), graphDb.schema().getIndexPopulationProgress(definition));
}
}, definitions);
return new ListRepresentation(RepresentationType.INDEX_DEFINITION, representations);
}
use of org.neo4j.server.rest.repr.ListRepresentation in project neo4j by neo4j.
the class JmxCompositeDataRepresentation method getValue.
@Mapping("value")
public ListRepresentation getValue() {
ArrayList<Representation> values = new ArrayList<Representation>();
for (Object key : data.getCompositeType().keySet()) {
String name = key.toString();
String description = data.getCompositeType().getDescription(name);
Representation value = REPRESENTATION_DISPATCHER.dispatch(data.get(name), "");
values.add(new NameDescriptionValueRepresentation(name, description, value));
}
return new ListRepresentation("value", values);
}
Aggregations