m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-11-03 13:33:32 +0100
committerMarcin Chrzanowski <marcin.j.chrzanowski@gmail.com>2019-11-03 13:33:32 +0100
commit9812ed30bd15324d2a337c8d838786a93f9df69f (patch)
tree0486fb7417cab98afe5e3ad80d95a8b9cee37b1b /src/main/java
parentb1078581d4730d4944180a739fcce51a39259112 (diff)
Add duration parsing tests
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/pl/edu/mimuw/cloudatlas/model/ValueDuration.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueDuration.java b/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueDuration.java
index bf9d0e0..444ce78 100644
--- a/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueDuration.java
+++ b/src/main/java/pl/edu/mimuw/cloudatlas/model/ValueDuration.java
@@ -152,6 +152,12 @@ public class ValueDuration extends ValueSimple<Long> {
return result;
}
+ /**
+ * @param matcher A regex matcher
+ * @param group The name of a group matched by <code>matcher</code> that
+ * should have captured a number.
+ * @return The parsed number.
+ */
private static long parseLongGroup(Matcher matcher, String group) {
return Long.parseLong(matcher.group(group));
}