aboutsummaryrefslogtreecommitdiff
path: root/Mammoth/Couscous/java/util/OptionalInt.cs
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2018-01-28 12:36:26 +0000
committerMichael Williamson <mike@zwobble.org>2018-01-28 12:36:26 +0000
commit56e424be69f5728d36ed59509284e6592ee374ce (patch)
treec66d20ce4bb0d68518bf7d5fff839913f0fe4866 /Mammoth/Couscous/java/util/OptionalInt.cs
parentc5f9b5e6971da9611b599991858e9c4dd23ee008 (diff)
Update java-mammoth
Diffstat (limited to 'Mammoth/Couscous/java/util/OptionalInt.cs')
-rw-r--r--Mammoth/Couscous/java/util/OptionalInt.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Mammoth/Couscous/java/util/OptionalInt.cs b/Mammoth/Couscous/java/util/OptionalInt.cs
index 4dfca2f..fb92624 100644
--- a/Mammoth/Couscous/java/util/OptionalInt.cs
+++ b/Mammoth/Couscous/java/util/OptionalInt.cs
@@ -6,6 +6,7 @@ namespace Mammoth.Couscous.java.util
{
bool isPresent();
int getAsInt();
+ int orElse(int elseValue);
}
internal struct NoneInt : OptionalInt {
@@ -18,6 +19,10 @@ namespace Mammoth.Couscous.java.util
public int getAsInt() {
throw new NoSuchElementException();
}
+
+ public int orElse(int elseValue) {
+ return elseValue;
+ }
}
internal struct SomeInt : OptionalInt {
@@ -34,5 +39,9 @@ namespace Mammoth.Couscous.java.util
public int getAsInt() {
return _value;
}
+
+ public int orElse(int elseValue) {
+ return _value;
+ }
}
}