functionalj.lens.lenses.java.time.ZoneOffsetAccess 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.
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.IntegerAccessPrimitive;
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 IntegerAccessPrimitive getTotalSeconds() {
return host -> {
val value = apply(host);
return value.getTotalSeconds();
};
}
public default ZoneRulesAccess getRules() {
return host -> {
val value = apply(host);
return value.getRules();
};
}
}