functionalj.lens.lenses.java.time.OffsetDateTimeAccess 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.OffsetDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.temporal.TemporalAdjuster;
import java.time.temporal.TemporalAmount;
import java.time.temporal.TemporalField;
import java.time.temporal.TemporalUnit;
import java.util.function.Function;
import functionalj.lens.lenses.AnyAccess;
import functionalj.lens.lenses.BooleanAccess;
import functionalj.lens.lenses.ConcreteAccess;
import functionalj.lens.lenses.IntegerAccess;
import functionalj.lens.lenses.LongAccess;
import lombok.val;
@FunctionalInterface
public interface OffsetDateTimeAccess
extends AnyAccess
, TemporalAccess
, TemporalAdjusterAccess
, ConcreteAccess > {
public static OffsetDateTimeAccess of(Function func) {
return func::apply;
}
public default OffsetDateTimeAccess newAccess(Function accessToValue) {
return host -> accessToValue.apply(host);
}
public default ZoneOffsetAccess getOffset() {
return host -> {
val value = apply(host);
return value.getOffset();
};
}
public default OffsetDateTimeAccess withOffsetSameLocal(ZoneOffset offset) {
return host -> {
val value = apply(host);
return value.withOffsetSameLocal(offset);
};
}
public default OffsetDateTimeAccess withOffsetSameInstant(ZoneOffset offset) {
return host -> {
val value = apply(host);
return value.withOffsetSameInstant(offset);
};
}
public default LocalDateTimeAccess toLocalDateTime() {
return host -> {
val value = apply(host);
return value.toLocalDateTime();
};
}
public default LocalDateAccess toLocalDate() {
return host -> {
val value = apply(host);
return value.toLocalDate();
};
}
public default IntegerAccess getYear() {
return host -> {
val value = apply(host);
return value.getYear();
};
}
public default IntegerAccess getMonthValue() {
return host -> {
val value = apply(host);
return value.getMonthValue();
};
}
public default MonthAccess getMonth() {
return host -> {
val value = apply(host);
return value.getMonth();
};
}
public default IntegerAccess getDayOfMonth() {
return host -> {
val value = apply(host);
return value.getDayOfMonth();
};
}
public default IntegerAccess getDayOfYear() {
return host -> {
val value = apply(host);
return value.getDayOfYear();
};
}
public default DayOfWeekAccess getDayOfWeek() {
return host -> {
val value = apply(host);
return value.getDayOfWeek();
};
}
public default LocalTimeAccess toLocalTime() {
return host -> {
val value = apply(host);
return value.toLocalTime();
};
}
public default IntegerAccess getHour() {
return host -> {
val value = apply(host);
return value.getHour();
};
}
public default IntegerAccess getMinute() {
return host -> {
val value = apply(host);
return value.getMinute();
};
}
public default IntegerAccess getSecond() {
return host -> {
val value = apply(host);
return value.getSecond();
};
}
public default IntegerAccess getNano() {
return host -> {
val value = apply(host);
return value.getNano();
};
}
public default OffsetDateTimeAccess with(TemporalAdjuster adjuster) {
return host -> {
val value = apply(host);
return value.with(adjuster);
};
}
public default OffsetDateTimeAccess with(TemporalField field, long newValue) {
return host -> {
val value = apply(host);
return value.with(field, newValue);
};
}
public default OffsetDateTimeAccess withYear(int year) {
return host -> {
val value = apply(host);
return value.withYear(year);
};
}
public default OffsetDateTimeAccess withMonth(int month) {
return host -> {
val value = apply(host);
return value.withMonth(month);
};
}
public default OffsetDateTimeAccess withDayOfMonth(int dayOfMonth) {
return host -> {
val value = apply(host);
return value.withDayOfMonth(dayOfMonth);
};
}
public default OffsetDateTimeAccess withDayOfYear(int dayOfYear) {
return host -> {
val value = apply(host);
return value.withDayOfYear(dayOfYear);
};
}
public default OffsetDateTimeAccess withHour(int hour) {
return host -> {
val value = apply(host);
return value.withHour(hour);
};
}
public default OffsetDateTimeAccess withMinute(int minute) {
return host -> {
val value = apply(host);
return value.withMinute(minute);
};
}
public default OffsetDateTimeAccess withSecond(int second) {
return host -> {
val value = apply(host);
return value.withSecond(second);
};
}
public default OffsetDateTimeAccess withNano(int nanoOfSecond) {
return host -> {
val value = apply(host);
return value.withNano(nanoOfSecond);
};
}
public default OffsetDateTimeAccess truncatedTo(TemporalUnit unit) {
return host -> {
val value = apply(host);
return value.truncatedTo(unit);
};
}
public default OffsetDateTimeAccess plus(TemporalAmount amountToAdd) {
return host -> {
val value = apply(host);
return value.plus(amountToAdd);
};
}
public default OffsetDateTimeAccess plus(long amountToAdd, TemporalUnit unit) {
return host -> {
val value = apply(host);
return value.plus(amountToAdd, unit);
};
}
public default OffsetDateTimeAccess plusYears(long years) {
return host -> {
val value = apply(host);
return value.plusYears(years);
};
}
public default OffsetDateTimeAccess plusMonths(long months) {
return host -> {
val value = apply(host);
return value.plusMonths(months);
};
}
public default OffsetDateTimeAccess plusWeeks(long weeks) {
return host -> {
val value = apply(host);
return value.plusWeeks(weeks);
};
}
public default OffsetDateTimeAccess plusDays(long days) {
return host -> {
val value = apply(host);
return value.plusDays(days);
};
}
public default OffsetDateTimeAccess plusHours(long hours) {
return host -> {
val value = apply(host);
return value.plusHours(hours);
};
}
public default OffsetDateTimeAccess plusMinutes(long minutes) {
return host -> {
val value = apply(host);
return value.plusMinutes(minutes);
};
}
public default OffsetDateTimeAccess plusSeconds(long seconds) {
return host -> {
val value = apply(host);
return value.plusSeconds(seconds);
};
}
public default OffsetDateTimeAccess plusNanos(long nanos) {
return host -> {
val value = apply(host);
return value.plusNanos(nanos);
};
}
public default OffsetDateTimeAccess minus(TemporalAmount amountToSubtract) {
return host -> {
val value = apply(host);
return value.minus(amountToSubtract);
};
}
public default OffsetDateTimeAccess minus(long amountToSubtract, TemporalUnit unit) {
return host -> {
val value = apply(host);
return value.minus(amountToSubtract, unit);
};
}
public default OffsetDateTimeAccess minusYears(long years) {
return host -> {
val value = apply(host);
return value.minusYears(years);
};
}
public default OffsetDateTimeAccess minusMonths(long months) {
return host -> {
val value = apply(host);
return value.minusMonths(months);
};
}
public default OffsetDateTimeAccess minusWeeks(long weeks) {
return host -> {
val value = apply(host);
return value.minusWeeks(weeks);
};
}
public default OffsetDateTimeAccess minusDays(long days) {
return host -> {
val value = apply(host);
return value.minusDays(days);
};
}
public default OffsetDateTimeAccess minusHours(long hours) {
return host -> {
val value = apply(host);
return value.minusHours(hours);
};
}
public default OffsetDateTimeAccess minusMinutes(long minutes) {
return host -> {
val value = apply(host);
return value.minusMinutes(minutes);
};
}
public default OffsetDateTimeAccess minusSeconds(long seconds) {
return host -> {
val value = apply(host);
return value.minusSeconds(seconds);
};
}
public default OffsetDateTimeAccess minusNanos(long nanos) {
return host -> {
val value = apply(host);
return value.minusNanos(nanos);
};
}
public default ZonedDateTimeAccess atZoneSameInstant(ZoneId zone) {
return host -> {
val value = apply(host);
return value.atZoneSameInstant(zone);
};
}
public default ZonedDateTimeAccess atZoneSimilarLocal(ZoneId zone) {
return host -> {
val value = apply(host);
return value.atZoneSimilarLocal(zone);
};
}
public default OffsetTimeAccess toOffsetTime() {
return host -> {
val value = apply(host);
return value.toOffsetTime();
};
}
public default ZonedDateTimeAccess toZonedDateTime() {
return host -> {
val value = apply(host);
return value.toZonedDateTime();
};
}
public default InstantAccess toInstant() {
return host -> {
val value = apply(host);
return value.toInstant();
};
}
public default LongAccess toEpochSecond() {
return host -> {
val value = apply(host);
return value.toEpochSecond();
};
}
public default IntegerAccess compareTo(OffsetDateTime other) {
return host -> {
val value = apply(host);
return value.compareTo(other);
};
}
public default BooleanAccess thatGreaterThan(OffsetDateTime anotherValue) {
return booleanAccess(false, any -> any.compareTo(anotherValue) > 0);
}
public default BooleanAccess thatLessThan(OffsetDateTime anotherValue) {
return booleanAccess(false, any -> any.compareTo(anotherValue) < 0);
}
public default BooleanAccess thatGreaterThanOrEqualsTo(OffsetDateTime anotherValue) {
return booleanAccess(false, any -> any.compareTo(anotherValue) >= 0);
}
public default BooleanAccess thatLessThanOrEqualsTo(OffsetDateTime anotherValue) {
return booleanAccess(false, any -> any.compareTo(anotherValue) <= 0);
}
public default BooleanAccess thatIsAfter(OffsetDateTime other) {
return host -> {
val value = apply(host);
return value.isAfter(other);
};
}
public default BooleanAccess thatIsBefore(OffsetDateTime other) {
return host -> {
val value = apply(host);
return value.isBefore(other);
};
}
public default BooleanAccess thatIsEqual(OffsetDateTime other) {
return host -> {
val value = apply(host);
return value.isEqual(other);
};
}
}