Leon 7 gadus atpakaļ
vecāks
revīzija
4417467f67

+ 69
- 74
.idea/workspace.xml Parādīt failu

@@ -2,13 +2,7 @@
2 2
 <project version="4">
3 3
   <component name="ChangeListManager">
4 4
     <list default="true" id="30b7e4a0-b899-49c3-865c-0311dfadae62" name="Default" comment="">
5
-      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java" />
6
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
7
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java" />
8
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ArrayConverter.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ArrayConverter.java" />
9
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java" />
10
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ListConverter.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ListConverter.java" />
11
-      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/StreamConverter.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/StreamConverter.java" />
5
+      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" afterPath="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" />
12 6
     </list>
13 7
     <ignored path="$PROJECT_DIR$/out/" />
14 8
     <ignored path="$PROJECT_DIR$/target/" />
@@ -43,11 +37,11 @@
43 37
           </provider>
44 38
         </entry>
45 39
       </file>
46
-      <file leaf-file-name="PersonWarehouse.java" pinned="false" current-in-tab="false">
40
+      <file leaf-file-name="PersonWarehouse.java" pinned="false" current-in-tab="true">
47 41
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
48 42
           <provider selected="true" editor-type-id="text-editor">
49
-            <state relative-caret-position="-343">
50
-              <caret line="14" column="109" lean-forward="false" selection-start-line="14" selection-start-column="109" selection-end-line="14" selection-end-column="109" />
43
+            <state relative-caret-position="945">
44
+              <caret line="72" column="15" lean-forward="true" selection-start-line="72" selection-start-column="15" selection-end-line="72" selection-end-column="15" />
51 45
               <folding />
52 46
             </state>
53 47
           </provider>
@@ -56,8 +50,8 @@
56 50
       <file leaf-file-name="ArrayConverter.java" pinned="false" current-in-tab="false">
57 51
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ArrayConverter.java">
58 52
           <provider selected="true" editor-type-id="text-editor">
59
-            <state relative-caret-position="345">
60
-              <caret line="35" column="20" lean-forward="false" selection-start-line="35" selection-start-column="20" selection-end-line="35" selection-end-column="20" />
53
+            <state relative-caret-position="105">
54
+              <caret line="12" column="19" lean-forward="false" selection-start-line="12" selection-start-column="19" selection-end-line="12" selection-end-column="19" />
61 55
               <folding />
62 56
             </state>
63 57
           </provider>
@@ -66,22 +60,22 @@
66 60
       <file leaf-file-name="ListConverter.java" pinned="false" current-in-tab="false">
67 61
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ListConverter.java">
68 62
           <provider selected="true" editor-type-id="text-editor">
69
-            <state relative-caret-position="255">
70
-              <caret line="24" column="20" lean-forward="false" selection-start-line="24" selection-start-column="20" selection-end-line="24" selection-end-column="20" />
63
+            <state relative-caret-position="360">
64
+              <caret line="34" column="49" lean-forward="true" selection-start-line="34" selection-start-column="49" selection-end-line="34" selection-end-column="49" />
71 65
               <folding />
72 66
             </state>
73 67
           </provider>
74 68
         </entry>
75 69
       </file>
76
-      <file leaf-file-name="ConversionAgent.java" pinned="false" current-in-tab="true">
70
+      <file leaf-file-name="ConversionAgent.java" pinned="false" current-in-tab="false">
77 71
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java">
78 72
           <provider selected="true" editor-type-id="text-editor">
79
-            <state relative-caret-position="141">
80
-              <caret line="12" column="34" lean-forward="false" selection-start-line="12" selection-start-column="34" selection-end-line="12" selection-end-column="34" />
73
+            <state relative-caret-position="435">
74
+              <caret line="29" column="7" lean-forward="true" selection-start-line="29" selection-start-column="7" selection-end-line="29" selection-end-column="7" />
81 75
               <folding>
82 76
                 <element signature="imports" expanded="true" />
83
-                <element signature="e#740#741#0" expanded="true" />
84
-                <element signature="e#792#793#0" expanded="true" />
77
+                <element signature="e#807#808#0" expanded="true" />
78
+                <element signature="e#859#860#0" expanded="true" />
85 79
               </folding>
86 80
             </state>
87 81
           </provider>
@@ -90,16 +84,26 @@
90 84
       <file leaf-file-name="PersonConversionAgent.java" pinned="false" current-in-tab="false">
91 85
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java">
92 86
           <provider selected="true" editor-type-id="text-editor">
93
-            <state relative-caret-position="195">
94
-              <caret line="13" column="0" lean-forward="true" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
87
+            <state relative-caret-position="135">
88
+              <caret line="9" column="22" lean-forward="false" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
95 89
               <folding>
96
-                <element signature="e#438#439#0" expanded="true" />
97
-                <element signature="e#481#482#0" expanded="true" />
90
+                <element signature="e#504#505#0" expanded="true" />
91
+                <element signature="e#547#548#0" expanded="true" />
98 92
               </folding>
99 93
             </state>
100 94
           </provider>
101 95
         </entry>
102 96
       </file>
97
+      <file leaf-file-name="DateUtils.java" pinned="false" current-in-tab="false">
98
+        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java">
99
+          <provider selected="true" editor-type-id="text-editor">
100
+            <state relative-caret-position="343">
101
+              <caret line="57" column="41" lean-forward="true" selection-start-line="57" selection-start-column="41" selection-end-line="57" selection-end-column="41" />
102
+              <folding />
103
+            </state>
104
+          </provider>
105
+        </entry>
106
+      </file>
103 107
       <file leaf-file-name="Person.java" pinned="false" current-in-tab="false">
104 108
         <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/Person.java">
105 109
           <provider selected="true" editor-type-id="text-editor">
@@ -120,16 +124,6 @@
120 124
           </provider>
121 125
         </entry>
122 126
       </file>
123
-      <file leaf-file-name="ReflectionUtils.java" pinned="false" current-in-tab="false">
124
-        <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/ReflectionUtils.java">
125
-          <provider selected="true" editor-type-id="text-editor">
126
-            <state relative-caret-position="270">
127
-              <caret line="23" column="61" lean-forward="true" selection-start-line="23" selection-start-column="61" selection-end-line="23" selection-end-column="61" />
128
-              <folding />
129
-            </state>
130
-          </provider>
131
-        </entry>
132
-      </file>
133 127
     </leaf>
134 128
   </component>
135 129
   <component name="FileTemplateManagerImpl">
@@ -209,7 +203,6 @@
209 203
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/logging/LoggerHandler.java" />
210 204
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/StreamMap.java" />
211 205
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWorld.java" />
212
-        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" />
213 206
         <option value="$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/TestStreamFilter.java" />
214 207
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/StreamFilter.java" />
215 208
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/ReflectionUtils.java" />
@@ -224,6 +217,7 @@
224 217
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/StreamConverter.java" />
225 218
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java" />
226 219
         <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java" />
220
+        <option value="$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java" />
227 221
       </list>
228 222
     </option>
229 223
   </component>
@@ -1095,6 +1089,7 @@
1095 1089
       <provider selected="true" editor-type-id="text-editor">
1096 1090
         <state relative-caret-position="415">
1097 1091
           <caret line="481" column="10" lean-forward="true" selection-start-line="481" selection-start-column="10" selection-end-line="481" selection-end-column="10" />
1092
+          <folding />
1098 1093
         </state>
1099 1094
       </provider>
1100 1095
     </entry>
@@ -1135,14 +1130,6 @@
1135 1130
         </state>
1136 1131
       </provider>
1137 1132
     </entry>
1138
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java">
1139
-      <provider selected="true" editor-type-id="text-editor">
1140
-        <state relative-caret-position="97">
1141
-          <caret line="24" column="5" lean-forward="false" selection-start-line="24" selection-start-column="5" selection-end-line="24" selection-end-column="5" />
1142
-          <folding />
1143
-        </state>
1144
-      </provider>
1145
-    </entry>
1146 1133
     <entry file="file://$PROJECT_DIR$/src/test/java/com/zipcodewilmington/streams/TestSuiteFullRegression.java">
1147 1134
       <provider selected="true" editor-type-id="text-editor">
1148 1135
         <state relative-caret-position="240">
@@ -1252,74 +1239,82 @@
1252 1239
         </state>
1253 1240
       </provider>
1254 1241
     </entry>
1255
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/Person.java">
1242
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java">
1256 1243
       <provider selected="true" editor-type-id="text-editor">
1257
-        <state relative-caret-position="225">
1258
-          <caret line="19" column="0" lean-forward="false" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" />
1244
+        <state relative-caret-position="56">
1245
+          <caret line="12" column="1" lean-forward="false" selection-start-line="12" selection-start-column="1" selection-end-line="12" selection-end-column="109" />
1259 1246
           <folding />
1260 1247
         </state>
1261 1248
       </provider>
1262 1249
     </entry>
1263
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonFactory.java">
1250
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/Person.java">
1264 1251
       <provider selected="true" editor-type-id="text-editor">
1265
-        <state relative-caret-position="56">
1266
-          <caret line="12" column="1" lean-forward="false" selection-start-line="12" selection-start-column="1" selection-end-line="12" selection-end-column="109" />
1252
+        <state relative-caret-position="225">
1253
+          <caret line="19" column="0" lean-forward="false" selection-start-line="19" selection-start-column="0" selection-end-line="19" selection-end-column="0" />
1267 1254
           <folding />
1268 1255
         </state>
1269 1256
       </provider>
1270 1257
     </entry>
1271
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
1258
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java">
1272 1259
       <provider selected="true" editor-type-id="text-editor">
1273
-        <state relative-caret-position="-343">
1274
-          <caret line="14" column="109" lean-forward="false" selection-start-line="14" selection-start-column="109" selection-end-line="14" selection-end-column="109" />
1275
-          <folding />
1260
+        <state relative-caret-position="135">
1261
+          <caret line="9" column="22" lean-forward="false" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
1262
+          <folding>
1263
+            <element signature="e#504#505#0" expanded="true" />
1264
+            <element signature="e#547#548#0" expanded="true" />
1265
+          </folding>
1276 1266
         </state>
1277 1267
       </provider>
1278 1268
     </entry>
1279
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ArrayConverter.java">
1269
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/StreamConverter.java">
1280 1270
       <provider selected="true" editor-type-id="text-editor">
1281
-        <state relative-caret-position="345">
1282
-          <caret line="35" column="20" lean-forward="false" selection-start-line="35" selection-start-column="20" selection-end-line="35" selection-end-column="20" />
1271
+        <state relative-caret-position="165">
1272
+          <caret line="16" column="64" lean-forward="true" selection-start-line="16" selection-start-column="64" selection-end-line="16" selection-end-column="64" />
1283 1273
           <folding />
1284 1274
         </state>
1285 1275
       </provider>
1286 1276
     </entry>
1287
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ListConverter.java">
1277
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java">
1288 1278
       <provider selected="true" editor-type-id="text-editor">
1289
-        <state relative-caret-position="255">
1290
-          <caret line="24" column="20" lean-forward="false" selection-start-line="24" selection-start-column="20" selection-end-line="24" selection-end-column="20" />
1279
+        <state relative-caret-position="343">
1280
+          <caret line="57" column="41" lean-forward="true" selection-start-line="57" selection-start-column="41" selection-end-line="57" selection-end-column="41" />
1291 1281
           <folding />
1292 1282
         </state>
1293 1283
       </provider>
1294 1284
     </entry>
1295
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/PersonConversionAgent.java">
1285
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java">
1296 1286
       <provider selected="true" editor-type-id="text-editor">
1297
-        <state relative-caret-position="195">
1298
-          <caret line="13" column="0" lean-forward="true" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
1287
+        <state relative-caret-position="435">
1288
+          <caret line="29" column="7" lean-forward="true" selection-start-line="29" selection-start-column="7" selection-end-line="29" selection-end-column="7" />
1299 1289
           <folding>
1300
-            <element signature="e#438#439#0" expanded="true" />
1301
-            <element signature="e#481#482#0" expanded="true" />
1290
+            <element signature="imports" expanded="true" />
1291
+            <element signature="e#807#808#0" expanded="true" />
1292
+            <element signature="e#859#860#0" expanded="true" />
1302 1293
           </folding>
1303 1294
         </state>
1304 1295
       </provider>
1305 1296
     </entry>
1306
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/StreamConverter.java">
1297
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ArrayConverter.java">
1307 1298
       <provider selected="true" editor-type-id="text-editor">
1308
-        <state relative-caret-position="165">
1309
-          <caret line="16" column="64" lean-forward="true" selection-start-line="16" selection-start-column="64" selection-end-line="16" selection-end-column="64" />
1299
+        <state relative-caret-position="105">
1300
+          <caret line="12" column="19" lean-forward="false" selection-start-line="12" selection-start-column="19" selection-end-line="12" selection-end-column="19" />
1310 1301
           <folding />
1311 1302
         </state>
1312 1303
       </provider>
1313 1304
     </entry>
1314
-    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ConversionAgent.java">
1305
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/conversions/ListConverter.java">
1315 1306
       <provider selected="true" editor-type-id="text-editor">
1316
-        <state relative-caret-position="141">
1317
-          <caret line="12" column="34" lean-forward="false" selection-start-line="12" selection-start-column="34" selection-end-line="12" selection-end-column="34" />
1318
-          <folding>
1319
-            <element signature="imports" expanded="true" />
1320
-            <element signature="e#740#741#0" expanded="true" />
1321
-            <element signature="e#792#793#0" expanded="true" />
1322
-          </folding>
1307
+        <state relative-caret-position="360">
1308
+          <caret line="34" column="49" lean-forward="true" selection-start-line="34" selection-start-column="49" selection-end-line="34" selection-end-column="49" />
1309
+          <folding />
1310
+        </state>
1311
+      </provider>
1312
+    </entry>
1313
+    <entry file="file://$PROJECT_DIR$/src/main/java/com/zipcodewilmington/streams/anthropoid/PersonWarehouse.java">
1314
+      <provider selected="true" editor-type-id="text-editor">
1315
+        <state relative-caret-position="945">
1316
+          <caret line="72" column="15" lean-forward="true" selection-start-line="72" selection-start-column="15" selection-end-line="72" selection-end-column="15" />
1317
+          <folding />
1323 1318
         </state>
1324 1319
       </provider>
1325 1320
     </entry>

+ 27
- 0
src/main/java/com/zipcodewilmington/streams/tools/DateUtils.java Parādīt failu

@@ -20,26 +20,53 @@ public final class DateUtils {
20 20
         return Date.from(localDate.atStartOfDay().atZone(ZoneId.systemDefault()).toInstant());
21 21
     }
22 22
 
23
+    /**
24
+     * @param localDateTime LocalDateTime object to convert
25
+     * @return respective Date-object-representation
26
+     */
23 27
     public static Date asDate(LocalDateTime localDateTime) {
24 28
         return Date.from(localDateTime.atZone(ZoneId.systemDefault()).toInstant());
25 29
     }
26 30
 
31
+    /**
32
+     * @param date Date object to convert
33
+     * @return respective LocalDate-object-representation
34
+     */
27 35
     public static LocalDate asLocalDate(Date date) {
28 36
         return Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDate();
29 37
     }
30 38
 
39
+    /**
40
+     * @param date Date object to convert
41
+     * @return respective LocalDateTime-object-representation
42
+     */
31 43
     public static LocalDateTime asLocalDateTime(Date date) {
32 44
         return Instant.ofEpochMilli(date.getTime()).atZone(ZoneId.systemDefault()).toLocalDateTime();
33 45
     }
34 46
 
47
+    /**
48
+     * @param startDate starting Date object
49
+     * @param endDate ending Date object
50
+     * @return integer difference between the two Date arguments
51
+     */
35 52
     public static int yearsBetween(Date startDate, Date endDate) {
36 53
         return yearsBetween(DateUtils.asLocalDate(startDate), DateUtils.asLocalDate(endDate));
37 54
     }
38 55
 
56
+    /**
57
+     * @param startDate starting Date object
58
+     * @param endDate ending LocalDate object
59
+     * @return integer difference between the two Date arguments
60
+     */
39 61
     public static int yearsBetween(Date startDate, LocalDate endDate) {
40 62
         return yearsBetween(DateUtils.asLocalDate(startDate), endDate);
41 63
     }
42 64
 
65
+    /**
66
+     * @param startDate starting LocalDate object
67
+     * @param endDate ending LocalDate object
68
+     * @return integer difference between the two Date arguments
69
+     */
43 70
     public static int yearsBetween(LocalDate startDate, LocalDate endDate) {
44 71
         return Period.between(startDate, endDate).getYears();
45 72
     }