
io.github.vipcxj.jasync.spec.switchexpr.EnumCase Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jasync-spec Show documentation
Show all versions of jasync-spec Show documentation
JAsync implements Async-Await fashion for Java just like es and c#.
This library provide the spec of all public api.
package io.github.vipcxj.jasync.spec.switchexpr;
import io.github.vipcxj.jasync.spec.functional.VoidPromiseSupplier;
public class EnumCase> implements ICase> {
private final E cond;
private final VoidPromiseSupplier body;
public EnumCase(E cond, VoidPromiseSupplier body) {
this.cond = cond;
this.body = body;
}
public E getCond() {
return cond;
}
@Override
public VoidPromiseSupplier getBody() {
return body;
}
@Override
public boolean is(Enum v, boolean findingDefault) {
return !findingDefault && v == cond;
}
public static > EnumCase of(E cond, VoidPromiseSupplier body) {
return new EnumCase<>(cond, body);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy