Skip to content

Instantly share code, notes, and snippets.

MiscUtils.java:
public static <T, C extends T> void with(T object, Class<C> asCastType, Consumer<C> consumer) {
consumer.accept((C) object);
}
I can be used like this:
BaseOpeningDay dayToBeSet = new OpeningDay();
# Definition
# Structure
```
import <FullyQualifiedTypeName>[.<StaticMethod>] [as <Alias>]
package <Name> {
[class, interface, enum, struct]
}
[private] enum <Name> {