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

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

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

import java.time.LocalTime;

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

public class LocalTimeLens
            extends    ObjectLensImpl
            implements LocalTimeAccess {
    
    public static final LocalTimeLens theLocalTime = new LocalTimeLens(LensSpec.of(LocalTime.class));
    
    public final IntegerLens hour   = createSubLens(LocalTime::getHour,   LocalTime::withHour,   IntegerLens::of);
    public final IntegerLens minute = createSubLens(LocalTime::getMinute, LocalTime::withMinute, IntegerLens::of);
    public final IntegerLens second = createSubLens(LocalTime::getSecond, LocalTime::withSecond, IntegerLens::of);
    public final IntegerLens nano   = createSubLens(LocalTime::getNano,   LocalTime::withNano,   IntegerLens::of);
    
    public static  LocalTimeLens of(LensSpec spec) {
        return new LocalTimeLens(spec);
    }
    
    public LocalTimeLens(LensSpec spec) {
        super(spec);
    }
    
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy