All Downloads are FREE. Search and download functionalities are using the official Maven repository.

functionalj.lens.lenses.RuleLens Maven / Gradle / Ivy

There is a newer version: 1.0.17
Show newest version
// 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;
//    }
//
//}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy