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

functionalj.lens.lenses.java.time.DurationLens Maven / Gradle / Ivy

There is a newer version: 1.0.17
Show newest version
package functionalj.lens.lenses.java.time;

import java.time.DayOfWeek;
import java.time.Duration;

import functionalj.lens.core.LensSpec;
import functionalj.lens.lenses.IntegerLens;
import functionalj.lens.lenses.LongLens;
import functionalj.lens.lenses.ObjectLensImpl;

public class DurationLens
                extends    ObjectLensImpl
                implements DurationAccess {
    
    public static final DurationLens theDuration = new DurationLens(LensSpec.of(Duration.class));
    
    public final LongLens    seconds = createSubLens(Duration::getSeconds, Duration::withSeconds, LongLens::of);
    public final IntegerLens nanos   = createSubLens(Duration::getNano,    Duration::withNanos,   IntegerLens::of);
    
    public static  DayOfWeekLens of(LensSpec spec) {
        return new DayOfWeekLens(spec);
    }
    
    public DurationLens(LensSpec spec) {
        super(spec);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy