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

writeServiceRepresentation(Service,String)   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 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