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

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

package functionalj.lens.lenses.java.time;

import java.time.ZoneOffset;
import java.util.function.Function;

import functionalj.lens.lenses.AnyAccess;
import functionalj.lens.lenses.ConcreteAccess;
import functionalj.lens.lenses.IntegerAccess;
import lombok.val;

@FunctionalInterface
public interface ZoneOffsetAccess
                   extends AnyAccess             
                   ,       ZoneIdAccess          
                   ,       TemporalAccessorAccess
                   ,       TemporalAdjusterAccess
                   ,       ConcreteAccess        > {
    
    public static  ZoneOffsetAccess of(Function func) {
        return func::apply;
    }
    
   public default ZoneOffsetAccess newAccess(Function accessToValue) {
       return accessToValue::apply;
   }
   
   public default IntegerAccess getTotalSeconds() {
       return host -> {
           val value = apply(host);
           return value.getTotalSeconds();
       };
   }
   
   public default ZoneRulesAccess getRules() {
       return host -> {
           val value = apply(host);
           return value.getRules();
       };
   }
   
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy