final SerializerProvider serializerProvider, final TypeSerializer typeSerializer) throws IOException {
ser(directionalVertex, jsonGenerator);
}
public void ser(final GraphSONVertex directionalVertex, final JsonGenerator jsonGenerator) throws IOException {
final Vertex vertex = directionalVertex.getVertexToSerialize();
final Map<String, Object> m = new HashMap<>();
m.put(GraphSONTokens.ID, vertex.id());
m.put(GraphSONTokens.LABEL, vertex.label());
m.put(GraphSONTokens.TYPE, GraphSONTokens.VERTEX);
final Object properties = StreamFactory.stream(vertex.iterators().propertyIterator())
.collect(Collectors.groupingBy(vp -> vp.key()));
final Object hiddens = StreamFactory.stream(vertex.iterators().hiddenPropertyIterator())
.collect(Collectors.groupingBy(vp -> vp.key()));
m.put(GraphSONTokens.PROPERTIES, properties);
m.put(GraphSONTokens.HIDDENS, hiddens);
if (directionalVertex.getDirection() == Direction.BOTH || directionalVertex.getDirection() == Direction.OUT) {
m.put(GraphSONTokens.OUT_E, StreamFactory.stream(vertex.iterators().edgeIterator(Direction.OUT)).collect(Collectors.toList()));
}
if (directionalVertex.getDirection() == Direction.BOTH || directionalVertex.getDirection() == Direction.IN) {
m.put(GraphSONTokens.IN_E, StreamFactory.stream(vertex.iterators().edgeIterator(Direction.IN)).collect(Collectors.toList()));
}
jsonGenerator.writeObject(m);
}