feat: add some javadoc

This commit is contained in:
Yadunand Prem
2022-10-16 03:46:01 +08:00
parent 6a4ef4ea70
commit 4ee04937da
9 changed files with 62 additions and 15 deletions

View File

@@ -21,15 +21,11 @@ public class Lazy<T> implements Immutatorable<T> {
@Override
public <R> Lazy<R> transform(Immutator<? extends R, ? super T> f) {
return Lazy.from(() -> f.invoke(this.init.init()));
return Lazy.from(() -> f.invoke(this.get()));
}
public <R> Lazy<R> next(Immutator<? extends Lazy<? extends R>, ? super T> f) {
@SuppressWarnings("unchecked")
Lazy<R> result = (Lazy<R>) Lazy.from(() -> f.invoke(this.init.init()));
return result;
return Lazy.<R>from(() -> f.invoke(this.get()).get());
}