Projekt

Obecné

Profil

« Předchozí | Další » 

Revize ce5bfed1

Přidáno uživatelem Jakub Šmíd před asi 2 roky(ů)

Changed coordinates to null from 0.0 when not known

re #9625

Zobrazit rozdíly:

backend/src/main/java/cz/zcu/kiv/backendapi/catalog/CatalogItem.java
49 49
    /**
50 50
     * Certainty
51 51
     */
52
    private int certainty;
52
    private Integer certainty;
53 53

  
54 54
    /**
55 55
     * Longitude
56 56
     */
57
    private double longitude;
57
    private Double longitude;
58 58

  
59 59
    /**
60 60
     * Latitude
61 61
     */
62
    private double latitude;
62
    private Double latitude;
63 63

  
64 64
    /**
65 65
     * Description
......
138 138
        this.bibliography = stringList.stream().map(s -> new Bibliography(s, this)).collect(Collectors.toSet());
139 139
    }
140 140

  
141
    private int processIntField(String field) {
141
    private Integer processIntField(String field) {
142 142
        Matcher matcher = Pattern.compile(INTEGER_PATTERN).matcher(field);
143 143
        if (matcher.find()) {
144 144
            return Integer.parseInt(matcher.group());
145 145
        } else {
146
            return 0;
146
            return null;
147 147
        }
148 148
    }
149 149

  
150
    private double processDoubleField(String field) {
150
    private Double processDoubleField(String field) {
151 151
        Matcher matcher = Pattern.compile(DOUBLE_PATTERN).matcher(field);
152 152
        if (matcher.find()) {
153 153
            return Double.parseDouble(matcher.group());
154 154
        } else {
155
            return 0.0;
155
            return null;
156 156
        }
157 157
    }
158 158

  

Také k dispozici: Unified diff