Passed
Pull Request — master (#26)
by
unknown
02:25 queued 18s
created

com.hltech.vaunt.generator.domain.representation.RepresentationWriter   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 8
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 8
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A writeServiceRepresentation(Service,String) 0 3 1
1
package com.hltech.vaunt.generator.domain.representation;
2
3
import com.fasterxml.jackson.databind.ObjectMapper;
4
import com.hltech.vaunt.generator.domain.representation.model.Service;
5
import lombok.RequiredArgsConstructor;
6
7
import java.io.File;
8
import java.io.IOException;
9
import java.nio.file.Paths;
10
11
@RequiredArgsConstructor
12
public class RepresentationWriter {
13
14
    private final ObjectMapper mapper;
15
16
    public void writeServiceRepresentation(Service service, String targetDirectory) throws IOException {
17
        File targetFile = Paths.get(targetDirectory).resolve(service.getName().concat(".json")).toFile();
18
        mapper.writeValue(targetFile, service);
19
    }
20
}
21