Skip to content

Commit

Permalink
renamed temporal to time, added support for DayOfWeek, Month, and Year
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Oct 3, 2024
1 parent a8d9fb6 commit 6acce44
Show file tree
Hide file tree
Showing 90 changed files with 1,338 additions and 561 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@
import io.github.mmm.property.builder.number.IntegerPropertyBuilder;
import io.github.mmm.property.builder.number.LongPropertyBuilder;
import io.github.mmm.property.builder.number.ShortPropertyBuilder;
import io.github.mmm.property.builder.temporal.InstantPropertyBuilder;
import io.github.mmm.property.builder.temporal.LocalDatePropertyBuilder;
import io.github.mmm.property.builder.temporal.LocalDateTimePropertyBuilder;
import io.github.mmm.property.builder.temporal.LocalTimePropertyBuilder;
import io.github.mmm.property.builder.temporal.OffsetDateTimePropertyBuilder;
import io.github.mmm.property.builder.temporal.OffsetTimePropertyBuilder;
import io.github.mmm.property.builder.temporal.ZonedDateTimePropertyBuilder;
import io.github.mmm.property.builder.time.DayOfWeekPropertyBuilder;
import io.github.mmm.property.builder.time.InstantPropertyBuilder;
import io.github.mmm.property.builder.time.LocalDatePropertyBuilder;
import io.github.mmm.property.builder.time.LocalDateTimePropertyBuilder;
import io.github.mmm.property.builder.time.LocalTimePropertyBuilder;
import io.github.mmm.property.builder.time.MonthPropertyBuilder;
import io.github.mmm.property.builder.time.OffsetDateTimePropertyBuilder;
import io.github.mmm.property.builder.time.OffsetTimePropertyBuilder;
import io.github.mmm.property.builder.time.YearPropertyBuilder;
import io.github.mmm.property.builder.time.ZonedDateTimePropertyBuilder;
import io.github.mmm.property.number.bigdecimal.BigDecimalProperty;
import io.github.mmm.property.number.biginteger.BigIntegerProperty;
import io.github.mmm.property.number.bytes.ByteProperty;
Expand All @@ -41,13 +44,16 @@
import io.github.mmm.property.number.shorts.ShortProperty;
import io.github.mmm.property.pattern.PatternProperty;
import io.github.mmm.property.string.StringProperty;
import io.github.mmm.property.temporal.instant.InstantProperty;
import io.github.mmm.property.temporal.localdate.LocalDateProperty;
import io.github.mmm.property.temporal.localdatetime.LocalDateTimeProperty;
import io.github.mmm.property.temporal.localtime.LocalTimeProperty;
import io.github.mmm.property.temporal.offsetdatetime.OffsetDateTimeProperty;
import io.github.mmm.property.temporal.offsettime.OffsetTimeProperty;
import io.github.mmm.property.temporal.zoneddatetime.ZonedDateTimeProperty;
import io.github.mmm.property.time.dayofweek.DayOfWeekProperty;
import io.github.mmm.property.time.instant.InstantProperty;
import io.github.mmm.property.time.localdate.LocalDateProperty;
import io.github.mmm.property.time.localdatetime.LocalDateTimeProperty;
import io.github.mmm.property.time.localtime.LocalTimeProperty;
import io.github.mmm.property.time.month.MonthProperty;
import io.github.mmm.property.time.offsetdatetime.OffsetDateTimeProperty;
import io.github.mmm.property.time.offsettime.OffsetTimeProperty;
import io.github.mmm.property.time.year.YearProperty;
import io.github.mmm.property.time.zoneddatetime.ZonedDateTimeProperty;

/**
* Interface for a factory of {@link PropertyBuilder}s and {@link Property properties}. May optionally implement one of
Expand Down Expand Up @@ -255,6 +261,23 @@ default ByteProperty newByte(String name) {
return get(name, this, metadata -> accept(new ByteProperty(name, metadata), this));
}

/**
* @return a new {@link DayOfWeekPropertyBuilder}.
*/
default DayOfWeekPropertyBuilder newDayOfWeek() {

return builder(new DayOfWeekPropertyBuilder(getLock()), this);
}

/**
* @param name the {@link Property#getName() property name}.
* @return a new {@link DayOfWeekProperty}.
*/
default DayOfWeekProperty newDayOfWeek(String name) {

return get(name, this, metadata -> accept(new DayOfWeekProperty(name, metadata), this));
}

/**
* @return a new {@link InstantPropertyBuilder}.
*/
Expand Down Expand Up @@ -323,6 +346,23 @@ default LocalTimeProperty newLocalTime(String name) {
return get(name, this, metadata -> accept(new LocalTimeProperty(name, metadata), this));
}

/**
* @return a new {@link MonthPropertyBuilder}.
*/
default MonthPropertyBuilder newMonth() {

return builder(new MonthPropertyBuilder(getLock()), this);
}

/**
* @param name the {@link Property#getName() property name}.
* @return a new {@link MonthProperty}.
*/
default MonthProperty newMonth(String name) {

return get(name, this, metadata -> accept(new MonthProperty(name, metadata), this));
}

/**
* @return a new {@link OffsetDateTimePropertyBuilder}.
*/
Expand Down Expand Up @@ -357,6 +397,23 @@ default OffsetTimeProperty newOffsetTime(String name) {
return get(name, this, metadata -> accept(new OffsetTimeProperty(name, metadata), this));
}

/**
* @return a new {@link YearPropertyBuilder}.
*/
default YearPropertyBuilder newYear() {

return builder(new YearPropertyBuilder(getLock()), this);
}

/**
* @param name the {@link Property#getName() property name}.
* @return a new {@link YearProperty}.
*/
default YearProperty newYear(String name) {

return get(name, this, metadata -> accept(new YearProperty(name, metadata), this));
}

/**
* @return a new {@link ZonedDateTimePropertyBuilder}.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.time;

import java.time.DayOfWeek;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.time.dayofweek.DayOfWeekProperty;
import io.github.mmm.validation.time.dayofweek.ValidatorBuilderDayOfWeek;

/**
* {@link PropertyBuilder} for {@link DayOfWeekProperty}.
*
* @since 1.0.0
*/
public final class DayOfWeekPropertyBuilder extends
ComparablePropertyBuilder<DayOfWeek, DayOfWeekProperty, ValidatorBuilderDayOfWeek<DayOfWeekPropertyBuilder>, DayOfWeekPropertyBuilder> {

/**
* The constructor.
*
* @param lock the {@link #getLock() lock}.
*/
public DayOfWeekPropertyBuilder(AttributeReadOnly lock) {

super(lock);
}

@Override
protected ValidatorBuilderDayOfWeek<DayOfWeekPropertyBuilder> createValidatorBuilder() {

return new ValidatorBuilderDayOfWeek<>(this);
}

@Override
protected DayOfWeekProperty build(String name, PropertyMetadata<DayOfWeek> metadata) {

return new DayOfWeekProperty(name, metadata);
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;

import java.time.Instant;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.temporal.instant.InstantProperty;
import io.github.mmm.validation.temporal.instant.ValidatorBuilderInstant;
import io.github.mmm.property.time.instant.InstantProperty;
import io.github.mmm.validation.time.instant.ValidatorBuilderInstant;

/**
* {@link PropertyBuilder} for {@link InstantProperty}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;

import java.time.LocalDate;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.temporal.localdate.LocalDateProperty;
import io.github.mmm.validation.temporal.localdate.ValidatorBuilderLocalDate;
import io.github.mmm.property.time.localdate.LocalDateProperty;
import io.github.mmm.validation.time.localdate.ValidatorBuilderLocalDate;

/**
* {@link PropertyBuilder} for {@link LocalDateProperty}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;

import java.time.LocalDateTime;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.temporal.localdatetime.LocalDateTimeProperty;
import io.github.mmm.validation.temporal.localdatetime.ValidatorBuilderLocalDateTime;
import io.github.mmm.property.time.localdatetime.LocalDateTimeProperty;
import io.github.mmm.validation.time.localdatetime.ValidatorBuilderLocalDateTime;

/**
* {@link PropertyBuilder} for {@link LocalDateTimeProperty}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;

import java.time.LocalTime;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.temporal.localtime.LocalTimeProperty;
import io.github.mmm.validation.temporal.localtime.ValidatorBuilderLocalTime;
import io.github.mmm.property.time.localtime.LocalTimeProperty;
import io.github.mmm.validation.time.localtime.ValidatorBuilderLocalTime;

/**
* {@link PropertyBuilder} for {@link LocalTimeProperty}.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.time;

import java.time.Month;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.time.month.MonthProperty;
import io.github.mmm.validation.time.month.ValidatorBuilderMonth;

/**
* {@link PropertyBuilder} for {@link MonthProperty}.
*
* @since 1.0.0
*/
public final class MonthPropertyBuilder extends
ComparablePropertyBuilder<Month, MonthProperty, ValidatorBuilderMonth<MonthPropertyBuilder>, MonthPropertyBuilder> {

/**
* The constructor.
*
* @param lock the {@link #getLock() lock}.
*/
public MonthPropertyBuilder(AttributeReadOnly lock) {

super(lock);
}

@Override
protected ValidatorBuilderMonth<MonthPropertyBuilder> createValidatorBuilder() {

return new ValidatorBuilderMonth<>(this);
}

@Override
protected MonthProperty build(String name, PropertyMetadata<Month> metadata) {

return new MonthProperty(name, metadata);
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;

import java.time.OffsetDateTime;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.temporal.offsetdatetime.OffsetDateTimeProperty;
import io.github.mmm.validation.temporal.offsetdatetime.ValidatorBuilderOffsetDateTime;
import io.github.mmm.property.time.offsetdatetime.OffsetDateTimeProperty;
import io.github.mmm.validation.time.offsetdatetime.ValidatorBuilderOffsetDateTime;

/**
* {@link PropertyBuilder} for {@link OffsetDateTimeProperty}.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;

import java.time.OffsetTime;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.temporal.offsettime.OffsetTimeProperty;
import io.github.mmm.validation.temporal.offsettime.ValidatorBuilderOffsetTime;
import io.github.mmm.property.time.offsettime.OffsetTimeProperty;
import io.github.mmm.validation.time.offsettime.ValidatorBuilderOffsetTime;

/**
* {@link PropertyBuilder} for {@link OffsetTimeProperty}.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.time;

import java.time.Year;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.time.year.YearProperty;
import io.github.mmm.validation.time.year.ValidatorBuilderYear;

/**
* {@link PropertyBuilder} for {@link YearProperty}.
*
* @since 1.0.0
*/
public final class YearPropertyBuilder extends
ComparablePropertyBuilder<Year, YearProperty, ValidatorBuilderYear<YearPropertyBuilder>, YearPropertyBuilder> {

/**
* The constructor.
*
* @param lock the {@link #getLock() lock}.
*/
public YearPropertyBuilder(AttributeReadOnly lock) {

super(lock);
}

@Override
protected ValidatorBuilderYear<YearPropertyBuilder> createValidatorBuilder() {

return new ValidatorBuilderYear<>(this);
}

@Override
protected YearProperty build(String name, PropertyMetadata<Year> metadata) {

return new YearProperty(name, metadata);
}

}
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;

import java.time.ZonedDateTime;

import io.github.mmm.property.AttributeReadOnly;
import io.github.mmm.property.PropertyMetadata;
import io.github.mmm.property.builder.PropertyBuilder;
import io.github.mmm.property.builder.lang.ComparablePropertyBuilder;
import io.github.mmm.property.temporal.zoneddatetime.ZonedDateTimeProperty;
import io.github.mmm.validation.temporal.zoneddatetime.ValidatorBuilderZonedDateTime;
import io.github.mmm.property.time.zoneddatetime.ZonedDateTimeProperty;
import io.github.mmm.validation.time.zoneddatetime.ValidatorBuilderZonedDateTime;

/**
* {@link PropertyBuilder} for {@link ZonedDateTimeProperty}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/**
* Contains property builders for {@link java.time.temporal.Temporal} types.
*/
package io.github.mmm.property.builder.temporal;
package io.github.mmm.property.builder.time;
Loading

0 comments on commit 6acce44

Please sign in to comment.