Skip to content

Instantly share code, notes, and snippets.

@cajar1988 cajar1988/ Secret
Last active Nov 1, 2015

What would you like to do?
final int price = Match.of(vehicle)
.whenIs(Vehicle.CAR).then(() -> 17000)
.whenIs(Vehicle.BIKE).then(() -> 2000)
.whenIs(Vehicle.SKATEBOARD).then(() -> 500)
.getOption().orElseThrow(() -> new IllegalStateException("Unsupported vehicle=" + vehicle));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.