test_class.file: artemis-graph/src/test/java/org/jnosql/artemis/graph/AbstractGraphConverterTest.java
test_class.identifier: AbstractGraphConverterTest
test_case.body: @Test
      public void shouldConvertEntityToTinkerPopVertexUsingNativeName() {
          Movie movie = new Movie("Matrix", 1999, null);
          Vertex vertex = getConverter().toVertex(movie);
  
          assertEquals("movie", vertex.label());
          assertEquals(1999, Number.class.cast(vertex.value("movie_year")).intValue());
          assertEquals("Matrix", vertex.value("title"));
      }
test_case.class_method_signature: AbstractGraphConverterTest.shouldConvertEntityToTinkerPopVertexUsingNativeName()
test_case.full_signature: @Test public void shouldConvertEntityToTinkerPopVertexUsingNativeName()
test_case.identifier: shouldConvertEntityToTinkerPopVertexUsingNativeName
test_case.invocations: toVertex getConverter assertEquals label assertEquals intValue cast value assertEquals value
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldConvertEntityToTinkerPopVertexUsingNativeName()
focal_class.file: artemis-graph/src/main/java/org/jnosql/artemis/graph/AbstractGraphConverter.java
focal_class.identifier: AbstractGraphConverter
focal_class.interfaces: implements GraphConverter
focal_class.class_method_signature: AbstractGraphConverter.getClassMappings()
focal_class.full_signature: protected abstract ClassMappings getClassMappings()
focal_class.identifier: getClassMappings
focal_class.modifiers: protected abstract
focal_class.parameters: ()
focal_class.return: ClassMappings
focal_class.signature: ClassMappings getClassMappings()
focal_class.class_method_signature: AbstractGraphConverter.getConverters()
focal_class.full_signature: protected abstract Converters getConverters()
focal_class.identifier: getConverters
focal_class.modifiers: protected abstract
focal_class.parameters: ()
focal_class.return: Converters
focal_class.signature: Converters getConverters()
focal_class.class_method_signature: AbstractGraphConverter.getGraph()
focal_class.full_signature: protected abstract Graph getGraph()
focal_class.identifier: getGraph
focal_class.modifiers: protected abstract
focal_class.parameters: ()
focal_class.return: Graph
focal_class.signature: Graph getGraph()
focal_class.class_method_signature: AbstractGraphConverter.toVertex(T entity)
focal_class.full_signature: @Override public Vertex toVertex(T entity)
focal_class.identifier: toVertex
focal_class.modifiers: @Override public
focal_class.parameters: (T entity)
focal_class.return: Vertex
focal_class.signature: Vertex toVertex(T entity)
focal_class.class_method_signature: AbstractGraphConverter.getProperties(T entity)
focal_class.full_signature: @Override public List<Property<?>> getProperties(T entity)
focal_class.identifier: getProperties
focal_class.modifiers: @Override public
focal_class.parameters: (T entity)
focal_class.return: List<Property<?>>
focal_class.signature: List<Property<?>> getProperties(T entity)
focal_class.class_method_signature: AbstractGraphConverter.toEntity(Vertex vertex)
focal_class.full_signature: @Override public T toEntity(Vertex vertex)
focal_class.identifier: toEntity
focal_class.modifiers: @Override public
focal_class.parameters: (Vertex vertex)
focal_class.return: T
focal_class.signature: T toEntity(Vertex vertex)
focal_class.class_method_signature: AbstractGraphConverter.toEntity(Class<T> entityClass, Vertex vertex)
focal_class.full_signature: @Override public T toEntity(Class<T> entityClass, Vertex vertex)
focal_class.identifier: toEntity
focal_class.modifiers: @Override public
focal_class.parameters: (Class<T> entityClass, Vertex vertex)
focal_class.return: T
focal_class.signature: T toEntity(Class<T> entityClass, Vertex vertex)
focal_class.class_method_signature: AbstractGraphConverter.toEntity(T entityInstance, Vertex vertex)
focal_class.full_signature: @Override public T toEntity(T entityInstance, Vertex vertex)
focal_class.identifier: toEntity
focal_class.modifiers: @Override public
focal_class.parameters: (T entityInstance, Vertex vertex)
focal_class.return: T
focal_class.signature: T toEntity(T entityInstance, Vertex vertex)
focal_class.class_method_signature: AbstractGraphConverter.toEdgeEntity(Edge edge)
focal_class.full_signature: @Override public EdgeEntity toEdgeEntity(Edge edge)
focal_class.identifier: toEdgeEntity
focal_class.modifiers: @Override public
focal_class.parameters: (Edge edge)
focal_class.return: EdgeEntity
focal_class.signature: EdgeEntity toEdgeEntity(Edge edge)
focal_class.class_method_signature: AbstractGraphConverter.toEdge(EdgeEntity edge)
focal_class.full_signature: @Override public Edge toEdge(EdgeEntity edge)
focal_class.identifier: toEdge
focal_class.modifiers: @Override public
focal_class.parameters: (EdgeEntity edge)
focal_class.return: Edge
focal_class.signature: Edge toEdge(EdgeEntity edge)
focal_class.class_method_signature: AbstractGraphConverter.feedId(Vertex vertex, T entity)
focal_class.full_signature: private void feedId(Vertex vertex, T entity)
focal_class.identifier: feedId
focal_class.modifiers: private
focal_class.parameters: (Vertex vertex, T entity)
focal_class.return: void
focal_class.signature: void feedId(Vertex vertex, T entity)
focal_class.class_method_signature: AbstractGraphConverter.toEntity(Class<T> entityClass, List<Property> properties)
focal_class.full_signature: private T toEntity(Class<T> entityClass, List<Property> properties)
focal_class.identifier: toEntity
focal_class.modifiers: private
focal_class.parameters: (Class<T> entityClass, List<Property> properties)
focal_class.return: T
focal_class.signature: T toEntity(Class<T> entityClass, List<Property> properties)
focal_class.class_method_signature: AbstractGraphConverter.convertEntity(List<Property> elements, ClassMapping mapping, T instance)
focal_class.full_signature: private T convertEntity(List<Property> elements, ClassMapping mapping, T instance)
focal_class.identifier: convertEntity
focal_class.modifiers: private
focal_class.parameters: (List<Property> elements, ClassMapping mapping, T instance)
focal_class.return: T
focal_class.signature: T convertEntity(List<Property> elements, ClassMapping mapping, T instance)
focal_class.class_method_signature: AbstractGraphConverter.feedObject(T instance, List<Property> elements,
                                              Map<String, FieldMapping> fieldsGroupByName)
focal_class.full_signature: private Consumer<String> feedObject(T instance, List<Property> elements,
                                              Map<String, FieldMapping> fieldsGroupByName)
focal_class.identifier: feedObject
focal_class.modifiers: private
focal_class.parameters: (T instance, List<Property> elements,
                                              Map<String, FieldMapping> fieldsGroupByName)
focal_class.return: Consumer<String>
focal_class.signature: Consumer<String> feedObject(T instance, List<Property> elements,
                                              Map<String, FieldMapping> fieldsGroupByName)
focal_class.class_method_signature: AbstractGraphConverter.setSingleField(T instance, Optional<Property> element, FieldMapping field)
focal_class.full_signature: private void setSingleField(T instance, Optional<Property> element, FieldMapping field)
focal_class.identifier: setSingleField
focal_class.modifiers: private
focal_class.parameters: (T instance, Optional<Property> element, FieldMapping field)
focal_class.return: void
focal_class.signature: void setSingleField(T instance, Optional<Property> element, FieldMapping field)
focal_class.class_method_signature: AbstractGraphConverter.setEmbeddedField(T instance, List<Property> elements,
                                        FieldMapping field)
focal_class.full_signature: private void setEmbeddedField(T instance, List<Property> elements,
                                        FieldMapping field)
focal_class.identifier: setEmbeddedField
focal_class.modifiers: private
focal_class.parameters: (T instance, List<Property> elements,
                                        FieldMapping field)
focal_class.return: void
focal_class.signature: void setEmbeddedField(T instance, List<Property> elements,
                                        FieldMapping field)
focal_class.class_method_signature: AbstractGraphConverter.to(FieldMapping field, Object entityInstance)
focal_class.full_signature: protected FieldGraph to(FieldMapping field, Object entityInstance)
focal_class.identifier: to
focal_class.modifiers: protected
focal_class.parameters: (FieldMapping field, Object entityInstance)
focal_class.return: FieldGraph
focal_class.signature: FieldGraph to(FieldMapping field, Object entityInstance)
focal_method.body: @Override
      public <T> Vertex toVertex(T entity) {
          requireNonNull(entity, "entity is required");
  
          ClassMapping mapping = getClassMappings().get(entity.getClass());
          String label = mapping.getName();
  
          List<FieldGraph> fields = mapping.getFields().stream()
                  .map(f -> to(f, entity))
                  .filter(FieldGraph::isNotEmpty).collect(toList());
  
          Optional<FieldGraph> id = fields.stream().filter(FieldGraph::isId).findFirst();
          final Function<Property, Vertex> findVertexOrCreateWithId = p -> {
              Iterator<Vertex> vertices = getGraph().vertices(p.value());
              return vertices.hasNext() ? vertices.next() :
                      getGraph().addVertex(org.apache.tinkerpop.gremlin.structure.T.label, label,
                              org.apache.tinkerpop.gremlin.structure.T.id, p.value());
          };
  
          Vertex vertex = id.map(i -> i.toElement(getConverters()))
                  .map(findVertexOrCreateWithId)
                  .orElseGet(() -> getGraph().addVertex(label));
  
          fields.stream().filter(FieldGraph::isNotId)
                  .flatMap(f -> f.toElements(this, getConverters()).stream())
                  .forEach(p -> vertex.property(p.key(), p.value()));
  
          return vertex;
      }
focal_method.class_method_signature: AbstractGraphConverter.toVertex(T entity)
focal_method.full_signature: @Override public Vertex toVertex(T entity)
focal_method.identifier: toVertex
focal_method.invocations: requireNonNull get getClassMappings getClass getName collect filter map stream getFields to toList findFirst filter stream vertices getGraph value hasNext next addVertex getGraph value orElseGet map map toElement getConverters addVertex getGraph forEach flatMap filter stream stream toElements getConverters property key value
focal_method.modifiers: @Override public
focal_method.parameters: (T entity)
focal_method.return: Vertex
focal_method.signature: Vertex toVertex(T entity)