refactoring?
This commit is contained in:
parent
9b007eb228
commit
5e1168afc6
|
@ -1,15 +1,12 @@
|
|||
package com.rusefi.pinout;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
|
||||
public interface BoardInputs {
|
||||
List<?> getBoardYamlKeys();
|
||||
List<? extends File> getBoardYamlKeys();
|
||||
|
||||
Reader getReader(Object yamlKey) throws FileNotFoundException;
|
||||
Reader getReader(File yamlKey) throws FileNotFoundException;
|
||||
|
||||
String getName();
|
||||
|
||||
|
|
|
@ -32,13 +32,13 @@ public class FileSystemBoardInputsImpl implements BoardInputs {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<?> getBoardYamlKeys() {
|
||||
public List<? extends File> getBoardYamlKeys() {
|
||||
return boardYamlFiles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reader getReader(Object yamlKey) throws FileNotFoundException {
|
||||
return new FileReader((File)yamlKey);
|
||||
public Reader getReader(File yamlKey) throws FileNotFoundException {
|
||||
return new FileReader(yamlKey);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -225,7 +225,7 @@ public class PinoutLogic {
|
|||
}
|
||||
|
||||
private void readFiles() throws IOException {
|
||||
for (Object yamlFile : boardInputs.getBoardYamlKeys()) {
|
||||
for (File yamlFile : boardInputs.getBoardYamlKeys()) {
|
||||
header.append("// auto-generated by PinoutLogic.java based on " + yamlFile + "\n");
|
||||
readMetaInfo(yamlFile.toString(), boardInputs.getReader(yamlFile));
|
||||
}
|
||||
|
|
|
@ -72,12 +72,12 @@ public class PinoutLogicIntegratedTest {
|
|||
|
||||
BoardInputs testBoard = new BoardInputs() {
|
||||
@Override
|
||||
public List<?> getBoardYamlKeys() {
|
||||
return Collections.singletonList("key");
|
||||
public List<? extends File> getBoardYamlKeys() {
|
||||
return Collections.singletonList(new File("key"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Reader getReader(Object yamlKey) {
|
||||
public Reader getReader(File yamlKey) {
|
||||
return input;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue