mirror of
https://github.com/ilri/cgspace-java-helpers.git
synced 2024-12-22 21:22:22 +01:00
src/main/java: minor refactoring
Suggested by IntelliJ.
This commit is contained in:
parent
6ef9f521bf
commit
7fb78c2722
@ -10,14 +10,14 @@ import javax.annotation.Nullable;
|
||||
|
||||
public class CountriesVocabulary {
|
||||
|
||||
class Country {
|
||||
private String name; // required
|
||||
private String common_name; // optional
|
||||
private String official_name; // optional
|
||||
private String cgspace_name; // optional
|
||||
private String numeric; // required Hmmmm need to cast this...
|
||||
private String alpha_2; // required
|
||||
private String alpha_3; // required
|
||||
static class Country {
|
||||
private final String name; // required
|
||||
private final String common_name; // optional
|
||||
private final String official_name; // optional
|
||||
private final String cgspace_name; // optional
|
||||
private final String numeric; // required Hmmmm need to cast this...
|
||||
private final String alpha_2; // required
|
||||
private final String alpha_3; // required
|
||||
|
||||
public Country(
|
||||
String name,
|
||||
|
@ -24,6 +24,7 @@ import java.io.InputStreamReader;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class CountryCodeTagger extends AbstractCurationTask {
|
||||
public class CountryCodeTaggerConfig {
|
||||
@ -37,7 +38,7 @@ public class CountryCodeTagger extends AbstractCurationTask {
|
||||
private final Logger log = LogManager.getLogger();
|
||||
}
|
||||
|
||||
public class CountryCodeTaggerResult {
|
||||
public static class CountryCodeTaggerResult {
|
||||
private int status = Curator.CURATE_UNSET;
|
||||
private String result = null;
|
||||
|
||||
@ -102,7 +103,7 @@ public class CountryCodeTagger extends AbstractCurationTask {
|
||||
BufferedReader reader =
|
||||
new BufferedReader(
|
||||
new InputStreamReader(
|
||||
this.getClass().getResourceAsStream(config.isocodesJsonPath)));
|
||||
Objects.requireNonNull(this.getClass().getResourceAsStream(config.isocodesJsonPath))));
|
||||
ISO3166CountriesVocabulary isocodesCountriesJson =
|
||||
gson.fromJson(reader, ISO3166CountriesVocabulary.class);
|
||||
reader.close();
|
||||
@ -110,8 +111,8 @@ public class CountryCodeTagger extends AbstractCurationTask {
|
||||
reader =
|
||||
new BufferedReader(
|
||||
new InputStreamReader(
|
||||
this.getClass()
|
||||
.getResourceAsStream(config.cgspaceCountriesJsonPath)));
|
||||
Objects.requireNonNull(this.getClass()
|
||||
.getResourceAsStream(config.cgspaceCountriesJsonPath))));
|
||||
CGSpaceCountriesVocabulary cgspaceCountriesJson =
|
||||
gson.fromJson(reader, CGSpaceCountriesVocabulary.class);
|
||||
reader.close();
|
||||
|
Loading…
Reference in New Issue
Block a user