Tariq Hook 7 år sedan
förälder
incheckning
7af1ca3e15

+ 0
- 13
src/main/java/io/zipcoder/Item.java Visa fil

@@ -26,34 +26,21 @@ public class Item {
26 26
         return name;
27 27
     }
28 28
 
29
-    public void setName(String name) {
30
-        this.name = name;
31
-    }
32 29
 
33 30
     public Double getPrice() {
34 31
         return price;
35 32
     }
36 33
 
37
-    public void setPrice(Double price) {
38
-        this.price = price;
39
-    }
40 34
 
41 35
     public String getType() {
42 36
         return type;
43 37
     }
44 38
 
45
-    public void setType(String type) {
46
-        this.type = type;
47
-    }
48 39
 
49 40
     public String getExpiration() {
50 41
         return expiration;
51 42
     }
52 43
 
53
-    public void setExpiration(String expiration) {
54
-        this.expiration = expiration;
55
-    }
56
-
57 44
     @Override
58 45
     public String toString(){
59 46
         return "name:" + name + " price:" + price + " type:" + type + " expiration:" + expiration;

+ 1
- 6
src/main/java/io/zipcoder/ItemParser.java Visa fil

@@ -5,11 +5,6 @@ import java.util.Arrays;
5 5
 
6 6
 public class ItemParser {
7 7
 
8
-    /**
9
-     *
10
-     * @param rawData
11
-     * @return
12
-     */
13 8
 
14 9
     public ArrayList<String> parseRawDataIntoStringArray(String rawData){
15 10
         String stringPattern = "##";
@@ -22,7 +17,7 @@ public class ItemParser {
22 17
     }
23 18
 
24 19
     public ArrayList<String> findKeyValuePairsInRawItemData(String rawItem){
25
-        String stringPattern = ";";
20
+        String stringPattern = "[;|^]";
26 21
         ArrayList<String> response = splitStringWithRegexPattern(stringPattern , rawItem);
27 22
         return response;
28 23
     }

+ 2
- 0
src/main/java/io/zipcoder/Main.java Visa fil

@@ -2,6 +2,7 @@ package io.zipcoder;
2 2
 
3 3
 import org.apache.commons.io.IOUtils;
4 4
 
5
+
5 6
 public class Main {
6 7
 
7 8
     public String readRawDataToString() throws Exception{
@@ -12,6 +13,7 @@ public class Main {
12 13
 
13 14
     public static void main(String[] args) throws Exception{
14 15
         String output = (new Main()).readRawDataToString();
16
+        System.out.println(output);
15 17
         // TODO: parse the data in output into items, and display to console.
16 18
     }
17 19
 }