Created
March 3, 2015 14:36
-
-
Save fge/93ceae333c7c4ef12dfb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.github.fge.lambdas.v2; | |
public abstract class Chain<N, T extends N, C extends Chain<N, T, C>> | |
{ | |
protected final T throwing; | |
protected Chain(final T throwing) | |
{ | |
this.throwing = throwing; | |
} | |
public abstract C orTryWith(T other); | |
public abstract <E extends RuntimeException> T orThrow(Class<E> exclass); | |
public abstract N fallbackTo(N fallback); | |
public final <E extends RuntimeException> T as(final Class<E> exclass) | |
{ | |
return orThrow(exclass); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment