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

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

package functionalj.lens.lenses.java.time;

import java.time.ZoneId;
import java.time.format.TextStyle;
import java.util.Locale;
import java.util.function.Function;

import functionalj.lens.lenses.AnyAccess;
import functionalj.lens.lenses.StringAccess;
import lombok.val;

@FunctionalInterface
public interface ZoneIdAccess
                    extends AnyAccess {
    
    public static  ZoneIdAccess of(Function func) {
        return func::apply;
    }
    
    public default StringAccess getId() {
        return host -> {
            val value = apply(host);
            return value.getId();
        };
    }
    public default StringAccess getDisplayName(TextStyle style, Locale locale) {
        return host -> {
            val value = apply(host);
            return value.getDisplayName(style, locale);
        };
    }
    
    public default ZoneRulesAccess getRules() {
        return host -> {
            val value = apply(host);
            return value.getRules();
        };
    }
    
    public default ZoneIdAccess normalized() {
        return host -> {
            val value = apply(host);
            return value.normalized();
        };
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy