Commit c902aeab authored by pysaumont's avatar pysaumont
Browse files

Fixing Option

parent 2a0e8d62
......@@ -6,7 +6,7 @@ public abstract class Option<A> {
public abstract <B> Option<B> map(Function<A, B> f);
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -51,7 +51,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("None has no value");
}
......@@ -100,7 +100,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -20,7 +20,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -49,7 +49,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -24,7 +24,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -53,7 +53,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -28,7 +28,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -57,7 +57,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -32,7 +32,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -61,7 +61,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -34,7 +34,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -63,7 +63,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -34,7 +34,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -63,7 +63,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -34,7 +34,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -63,7 +63,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -10,7 +10,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -35,7 +35,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -64,7 +64,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -10,7 +10,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -35,7 +35,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -64,7 +64,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -8,7 +8,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
private static class None<A> extends Option<A> {
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -20,7 +20,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -49,7 +49,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -24,7 +24,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -53,7 +53,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -28,7 +28,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -57,7 +57,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -34,7 +34,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -63,7 +63,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -34,7 +34,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -63,7 +63,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -34,7 +34,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -63,7 +63,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -9,7 +9,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -34,7 +34,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -63,7 +63,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -10,7 +10,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -35,7 +35,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -64,7 +64,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
......@@ -10,7 +10,7 @@ public abstract class Option<A> {
@SuppressWarnings("rawtypes")
private static Option none = new None();
public abstract A getOrThrow();
protected abstract A getOrThrow();
public abstract A getOrElse(Supplier<A> defaultValue);
......@@ -35,7 +35,7 @@ public abstract class Option<A> {
private None() {}
@Override
public A getOrThrow() {
protected A getOrThrow() {
throw new IllegalStateException("getOrThrow called on None");
}
......@@ -64,7 +64,7 @@ public abstract class Option<A> {
}
@Override
public A getOrThrow() {
protected A getOrThrow() {
return this.value;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment