Browse Source

added support to throw ItemParseException for all rawData

Joe Hendricks 6 years ago
parent
commit
b389c66b97
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/main/java/io/zipcoder/ItemParser.java

+ 2
- 1
src/main/java/io/zipcoder/ItemParser.java View File

21
 
21
 
22
     public Item parseStringIntoItem(String rawItem) throws ItemParseException {
22
     public Item parseStringIntoItem(String rawItem) throws ItemParseException {
23
 
23
 
24
-        if (findName(rawItem) == null || findPrice(rawItem) == null) {
24
+        if (findName(rawItem) == null || findPrice(rawItem) == null ||
25
+            findType(rawItem) == null || findExpiration(rawItem) == null) {
25
             throw new ItemParseException();
26
             throw new ItemParseException();
26
         }
27
         }
27
 
28