use of uk.gov.gchq.gaffer.rest.example.ExampleDomainObjectGenerator in project Gaffer by gchq.
the class ExamplesService method generateElements.
@Override
public GenerateElements generateElements() {
final GenerateElements<ExampleDomainObject> op = new GenerateElements<>(new ExampleDomainObjectGenerator());
final ArrayList<ExampleDomainObject> objs = new ArrayList<>();
if (hasEntities()) {
final SchemaElementDefinition entityDef = getSchema().getEntity(getAnEntityGroup());
objs.add(new ExampleDomainObject(getAnEntityGroup(), getExampleVertex(entityDef.getIdentifierClass(IdentifierType.VERTEX), 1)));
objs.add(new ExampleDomainObject(getAnEntityGroup(), getExampleVertex(entityDef.getIdentifierClass(IdentifierType.VERTEX), 2)));
}
if (hasEdges()) {
final SchemaElementDefinition edgeDef = getSchema().getEdge(getAnEdgeGroup());
objs.add(new ExampleDomainObject(getAnEdgeGroup(), getExampleVertex(edgeDef.getIdentifierClass(IdentifierType.SOURCE), 1), getExampleVertex(edgeDef.getIdentifierClass(IdentifierType.DESTINATION), 1), isAnEdgeDirected()));
}
op.setInput(objs);
populateOperation(op);
return op;
}
use of uk.gov.gchq.gaffer.rest.example.ExampleDomainObjectGenerator in project Gaffer by gchq.
the class ExamplesService method generateObjects.
@Override
public GenerateObjects generateObjects() {
final GenerateObjects<Element, ExampleDomainObject> op = new GenerateObjects<>(new ExampleDomainObjectGenerator());
List<Element> elements = new ArrayList<>();
if (hasEntities()) {
elements.add(getEntity(1));
elements.add(getEntity(2));
}
if (hasEdges()) {
elements.add(getEdge(1, 2));
}
op.setInput(elements);
populateOperation(op);
return op;
}
use of uk.gov.gchq.gaffer.rest.example.ExampleDomainObjectGenerator in project Gaffer by gchq.
the class ExamplesService method generateObjects.
@Override
public GenerateObjects generateObjects() {
final GenerateObjects<ExampleDomainObject> op = new GenerateObjects<>(new ExampleDomainObjectGenerator());
List<Element> elements = new ArrayList<>();
if (hasEntities()) {
elements.add(getEntity(1));
elements.add(getEntity(2));
}
if (hasEdges()) {
elements.add(getEdge(1, 2));
}
op.setInput(elements);
populateOperation(op);
return op;
}
use of uk.gov.gchq.gaffer.rest.example.ExampleDomainObjectGenerator in project Gaffer by gchq.
the class AbstractExamplesFactory method generateObjects.
public GenerateObjects generateObjects() {
final GenerateObjects<ExampleDomainObject> op = new GenerateObjects<>(new ExampleDomainObjectGenerator());
final List<Element> elements = new ArrayList<>();
if (hasEntities()) {
elements.add(getEntity(1));
elements.add(getEntity(2));
}
if (hasEdges()) {
elements.add(getEdge(1, 2));
}
op.setInput(elements);
populateOperation(op);
return op;
}
Aggregations