functionalj.lens.lenses.RuleLens Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionalj-core Show documentation
Show all versions of functionalj-core Show documentation
The module for FunctionalJ Core.
// TODO - Think about this again.
//package functionalj.lens.lenses;
//
//import java.util.function.Function;
//
//import functionalj.types.IRule;
//import functionalj.lens.core.LensSpec;
//import functionalj.lens.core.LensSpecParameterized;
//import functionalj.lens.core.LensUtils;
//import functionalj.lens.core.WriteLens;
//import functionalj.result.Result;
//
//
//public class RuleLens> implements ResultLens {
//
// public static >
// RuleLens createRuleLens(
// LensSpec lensSpec,
// Function> readSub,
// WriteLens> writeSub,
// Function, SUBLENS> subCreator) {
// val readThis = lensSpec.getRead();
// val writeThis = lensSpec.getWrite();
// val subRead = (Function>) LensUtils.createSubRead(readThis, readSub, lensSpec.getIsNullSafe());
// val subWrite = (WriteLens>)LensUtils.createSubWrite(readThis, writeThis, writeSub, lensSpec.getIsNullSafe());
// val spec = LensUtils.createLensSpecParameterized(subRead, subWrite, subCreator);
// val lens = new RuleLens(spec);
// return lens;
// }
//
// public static >
// RuleLens createRuleLens(
// Function> readSub,
// WriteLens> writeSub,
// Function, SUBLENS> subCreator) {
// val spec = LensUtils.createLensSpecParameterized(readSub, writeSub, subCreator);
// val lens = new RuleLens(spec);
// return lens;
// }
//
// private final LensSpecParameterized, SUB, SUBLENS> spec;
//
// public RuleLens(LensSpecParameterized, SUB, SUBLENS> spec) {
// this.spec = spec;
// }
//
// @SuppressWarnings({ "rawtypes", "unchecked" })
// @Override
// public LensSpecParameterized, SUB, SUBLENS> lensSpecWithSub() {
// return (LensSpecParameterized)spec;
// }
//
//}