diff --git a/core/src/main/java/io/github/mmm/value/ReadableTypedValue.java b/core/src/main/java/io/github/mmm/value/ReadableTypedValue.java deleted file mode 100644 index 3713db5..0000000 --- a/core/src/main/java/io/github/mmm/value/ReadableTypedValue.java +++ /dev/null @@ -1,19 +0,0 @@ -/* 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.value; - -/** - * {@link ReadableValue} knowing its {@link #getValueClass() value class}. - * - * @param type of the {@link #get() value}. - * @since 1.0.0 - */ -public interface ReadableTypedValue extends ReadableValue { - - /** - * @return the {@link Class} reflecting the type of {@link #get() values} that can be stored by this property. Even if - * the {@link #get() value} is {@code null} the property must support returning the property class. - */ - Class getValueClass(); - -} diff --git a/core/src/main/java/io/github/mmm/value/ReadableValue.java b/core/src/main/java/io/github/mmm/value/ReadableValue.java index 891fef4..ce5dc11 100644 --- a/core/src/main/java/io/github/mmm/value/ReadableValue.java +++ b/core/src/main/java/io/github/mmm/value/ReadableValue.java @@ -1,59 +1,65 @@ -/* 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.value; - -import java.util.function.Supplier; - -/** - * This interface gives read access to the {@link #get() value} of an object. - * - * @param type of the {@link #get() value}. - * @since 1.0.0 - */ -public abstract interface ReadableValue extends Supplier { - - /** - * @return the current value of this object. May be {@code null} unless otherwise stated. - */ - @Override - V get(); - - /** - * @return the value of {@link #get()} but in case this is {@code null} it will return {@link #getFallbackSafeValue()}. - * So unless {@link #getFallbackSafeValue()} also returns {@code null} this method a null-safe variant of - * {@link #get()}. - * @see #getFallbackSafeValue() - */ - default V getSafe() { - - V value = get(); - if (value == null) { - value = getFallbackSafeValue(); - } - return value; - } - - /** - * @return a neutral element to be used instead of {@code null} if supported for this type of value (e.g. "" for - * {@link String}, {@code 0} for any kind of {@link Number}, {@link Boolean#FALSE}, empty collection, etc.). - * May still be {@code null} for types that have no such neutral element. - */ - V getFallbackSafeValue(); - - /** - * Null-safe access to {@link #get()}. - * - * @param type of the {@link #get() value} - * @param value the {@link ReadableValue} to unwrap. - * @return the {@link #get() value} of the {@link ReadableValue}. Will be {@code null} if the given - * {@link ReadableValue} is {@code null} or its {@link #get() value} is {@code null}. - */ - static T get(ReadableValue value) { - - if (value == null) { - return null; - } - return value.get(); - } - -} +/* 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.value; + +import java.util.function.Supplier; + +/** + * This interface gives read access to the {@link #get() value} of an object. + * + * @param type of the {@link #get() value}. + * @since 1.0.0 + */ +public abstract interface ReadableValue extends Supplier { + + /** + * @return the current value of this object. May be {@code null} unless otherwise stated. + */ + @Override + V get(); + + /** + * @return the value of {@link #get()} but in case this is {@code null} it will return + * {@link #getFallbackSafeValue()}. So unless {@link #getFallbackSafeValue()} also returns {@code null} this + * method a null-safe variant of {@link #get()}. + * @see #getFallbackSafeValue() + */ + default V getSafe() { + + V value = get(); + if (value == null) { + value = getFallbackSafeValue(); + } + return value; + } + + /** + * @return a neutral element to be used instead of {@code null} if supported for this type of value (e.g. "" for + * {@link String}, {@code 0} for any kind of {@link Number}, {@link Boolean#FALSE}, empty collection, etc.). + * May still be {@code null} for types that have no such neutral element. + */ + V getFallbackSafeValue(); + + /** + * Null-safe access to {@link #get()}. + * + * @param type of the {@link #get() value} + * @param value the {@link ReadableValue} to unwrap. + * @return the {@link #get() value} of the {@link ReadableValue}. Will be {@code null} if the given + * {@link ReadableValue} is {@code null} or its {@link #get() value} is {@code null}. + */ + static T get(ReadableValue value) { + + if (value == null) { + return null; + } + return value.get(); + } + + /** + * @return the {@link Class} reflecting the type of {@link #get() value}. Even if the {@link #get() value} is + * {@code null} the property must support returning the value class. + */ + Class getValueClass(); + +} diff --git a/core/src/main/java/io/github/mmm/value/SimplePath.java b/core/src/main/java/io/github/mmm/value/SimplePath.java index 09ac498..30edab1 100644 --- a/core/src/main/java/io/github/mmm/value/SimplePath.java +++ b/core/src/main/java/io/github/mmm/value/SimplePath.java @@ -1,82 +1,88 @@ -/* 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.value; - -/** - * Implementation of {@link PropertyPath} for a plain path without {@link #get() value}. - * - * @since 1.0.0 - */ -public final class SimplePath implements PropertyPath { - - /** Name of the {@link #path() path} property for marshalling. */ - public static final String NAME_PATH = "path"; - - private final ReadablePath parent; - - private final String name; - - /** - * The constructor. - * - * @param parent the {@link #parentPath() parent path} or {@code null} for root. - * @param name the {@link #getName() name} and {@link #pathSegment() segment}. - */ - public SimplePath(ReadablePath parent, String name) { - - super(); - this.parent = parent; - this.name = name; - } - - @Override - public Object get() { - - return null; - } - - @Override - public Object getFallbackSafeValue() { - - return null; - } - - @Override - public String getName() { - - return this.name; - } - - @Override - public ReadablePath parentPath() { - - return this.parent; - } - - @Override - public String toString() { - - return path(); - } - - /** - * @param path the entire {@link #path()}. - * @return the given {@code path} parsed as {@link SimplePath}. - */ - public static SimplePath of(String path) { - - int start = 0; - SimplePath result = null; - while (true) { - int i = path.indexOf('.', start); - if (i == -1) { - return new SimplePath(result, path.substring(start)); - } else { - String segment = path.substring(start, i); - result = new SimplePath(result, segment); - start = i + 1; - } - } - } - -} +/* 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.value; + +/** + * Implementation of {@link PropertyPath} for a plain path without {@link #get() value}. + * + * @since 1.0.0 + */ +public final class SimplePath implements PropertyPath { + + /** Name of the {@link #path() path} property for marshalling. */ + public static final String NAME_PATH = "path"; + + private final ReadablePath parent; + + private final String name; + + /** + * The constructor. + * + * @param parent the {@link #parentPath() parent path} or {@code null} for root. + * @param name the {@link #getName() name} and {@link #pathSegment() segment}. + */ + public SimplePath(ReadablePath parent, String name) { + + super(); + this.parent = parent; + this.name = name; + } + + @Override + public Object get() { + + return null; + } + + @Override + public Object getFallbackSafeValue() { + + return null; + } + + @Override + public String getName() { + + return this.name; + } + + @Override + public ReadablePath parentPath() { + + return this.parent; + } + + @Override + public Class getValueClass() { + + return Object.class; + } + + @Override + public String toString() { + + return path(); + } + + /** + * @param path the entire {@link #path()}. + * @return the given {@code path} parsed as {@link SimplePath}. + */ + public static SimplePath of(String path) { + + int start = 0; + SimplePath result = null; + while (true) { + int i = path.indexOf('.', start); + if (i == -1) { + return new SimplePath(result, path.substring(start)); + } else { + String segment = path.substring(start, i); + result = new SimplePath(result, segment); + start = i + 1; + } + } + } + +} diff --git a/core/src/main/java/io/github/mmm/value/TypedPropertyPath.java b/core/src/main/java/io/github/mmm/value/TypedPropertyPath.java deleted file mode 100644 index 0d0bb8d..0000000 --- a/core/src/main/java/io/github/mmm/value/TypedPropertyPath.java +++ /dev/null @@ -1,14 +0,0 @@ -/* 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.value; - -/** - * A {@link PropertyPath} holding its {@link #getValueClass() type}. - * - * @param type of the {@link #get() value}. - * - * @since 1.0.0 - */ -public interface TypedPropertyPath extends PropertyPath, ReadableTypedValue { - -} diff --git a/observable/src/main/java/io/github/mmm/value/observable/booleans/ReadableBooleanValue.java b/observable/src/main/java/io/github/mmm/value/observable/booleans/ReadableBooleanValue.java index a51f473..b75f229 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/booleans/ReadableBooleanValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/booleans/ReadableBooleanValue.java @@ -1,40 +1,53 @@ -/* 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.value.observable.booleans; - -import io.github.mmm.value.ReadableTypedValue; -import io.github.mmm.value.observable.object.ReadableSimpleValue; - -/** - * {@link ReadableTypedValue} with {@link Boolean} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableBooleanValue extends ReadableSimpleValue { - - @Override - default Class getValueClass() { - - return Boolean.class; - } - - /** - * @return the current value as primitive {@code boolean}. - * @see #get() - */ - default boolean getValue() { - - Boolean value = get(); - if (value == null) { - return false; - } - return value.booleanValue(); - } - - @Override - default Boolean getFallbackSafeValue() { - - return Boolean.FALSE; - } - -} +/* 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.value.observable.booleans; + +import io.github.mmm.value.observable.object.ReadableSimpleValue; + +/** + * {@link ReadableSimpleValue} with {@link Boolean} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableBooleanValue extends ReadableSimpleValue { + + @Override + default Class getValueClass() { + + return Boolean.class; + } + + /** + * @return the current value as primitive {@code boolean}. + * @see #get() + */ + default boolean getValue() { + + Boolean value = get(); + if (value == null) { + return false; + } + return value.booleanValue(); + } + + @Override + default Boolean getFallbackSafeValue() { + + return Boolean.FALSE; + } + + @Override + default Boolean parse(String value) { + + if (value == null) { + return null; + } else if ("true".equalsIgnoreCase(value)) { + return Boolean.TRUE; + } else if ("false".equalsIgnoreCase(value)) { + return Boolean.FALSE; + } else { + throw new IllegalArgumentException(value); + } + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/booleans/WritableBooleanValue.java b/observable/src/main/java/io/github/mmm/value/observable/booleans/WritableBooleanValue.java index 49cfe61..aea2ebd 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/booleans/WritableBooleanValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/booleans/WritableBooleanValue.java @@ -23,18 +23,4 @@ default void setValue(boolean value) { set(Boolean.valueOf(value)); } - @Override - default Boolean parse(String value) { - - if (value == null) { - return null; - } else if ("true".equalsIgnoreCase(value)) { - return Boolean.TRUE; - } else if ("false".equalsIgnoreCase(value)) { - return Boolean.FALSE; - } else { - throw new IllegalArgumentException(value); - } - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/container/ReadableContainerValue.java b/observable/src/main/java/io/github/mmm/value/observable/container/ReadableContainerValue.java index 941398d..fd427d1 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/container/ReadableContainerValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/container/ReadableContainerValue.java @@ -2,10 +2,10 @@ * http://www.apache.org/licenses/LICENSE-2.0 */ package io.github.mmm.value.observable.container; -import io.github.mmm.value.observable.object.ReadableTypedObjectValue; +import io.github.mmm.value.observable.object.ReadableObjectValue; /** - * {@link ReadableTypedObjectValue} for container {@link #get() values} (e.g. {@link java.util.Collection} or + * {@link ReadableObjectValue} for container {@link #get() values} (e.g. {@link java.util.Collection} or * {@link java.util.Map}). * * @param type of the container {@link #get() value}. @@ -13,7 +13,7 @@ * {@link java.util.Map#containsValue(Object) map value}). * @since 1.0.0 */ -public interface ReadableContainerValue extends ReadableTypedObjectValue { +public interface ReadableContainerValue extends ReadableObjectValue { /** * @return the {@link java.util.Collection#size() size} of the {@link #get() container}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/enumeration/ReadableEnumValue.java b/observable/src/main/java/io/github/mmm/value/observable/enumeration/ReadableEnumValue.java index 63910c3..40d3aaf 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/enumeration/ReadableEnumValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/enumeration/ReadableEnumValue.java @@ -1,50 +1,54 @@ -/* 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.value.observable.enumeration; - -import io.github.mmm.value.ReadableTypedValue; -import io.github.mmm.value.observable.object.ReadableSimpleValue; - -/** - * {@link ReadableTypedValue} with {@link Enum} {@link #get() value}. - * - * @param type of {@link Enum} {@link #getValue() value}. - * @since 1.0.0 - */ -public interface ReadableEnumValue> extends ReadableSimpleValue { - - @Override - default String getAsString() { - - E e = get(); - if (e == null) { - return null; - } - return e.toString(); - } - - /** - * Same as {@link #get()}. - * - * @return the current {@link #get() value}. - */ - default E getValue() { - - return get(); - } - - @Override - default E getFallbackSafeValue() { - - Class valueClass = getValueClass(); - if (valueClass == null) { - return null; - } - E[] constants = valueClass.getEnumConstants(); - if (constants.length == 0) { - return null; - } - return constants[0]; - } - -} +/* 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.value.observable.enumeration; + +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; +import io.github.mmm.value.observable.object.ReadableSimpleValue; + +/** + * {@link ReadableSimpleValue} with {@link Enum} {@link #get() value}. + * + * @param type of {@link Enum} {@link #getValue() value}. + * @since 1.0.0 + */ +public interface ReadableEnumValue> extends ReadableSimpleObjectValue { + + @Override + default String getAsString() { + + E e = get(); + if (e == null) { + return null; + } + return e.toString(); + } + + @Override + default E getFallbackSafeValue() { + + Class valueClass = getValueClass(); + if (valueClass == null) { + return null; + } + E[] constants = valueClass.getEnumConstants(); + if (constants.length == 0) { + return null; + } + return constants[0]; + } + + @Override + default E parse(String value) { + + if (value == null) { + return null; + } + for (E e : getValueClass().getEnumConstants()) { + if (e.toString().equals(value)) { + return e; + } + } + throw new IllegalArgumentException("Undefined constant '" + value + "' for enum " + getValueClass().getName()); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/enumeration/WritableEnumValue.java b/observable/src/main/java/io/github/mmm/value/observable/enumeration/WritableEnumValue.java index 7301c35..be1f06a 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/enumeration/WritableEnumValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/enumeration/WritableEnumValue.java @@ -13,20 +13,6 @@ */ public interface WritableEnumValue> extends WritableSimpleValue, ReadableEnumValue { - @Override - default E parse(String value) { - - if (value == null) { - return null; - } - for (E e : getValueClass().getEnumConstants()) { - if (e.toString().equals(value)) { - return e; - } - } - throw new IllegalArgumentException("Undefined constant '" + value + "' for enum " + getValueClass().getName()); - } - /** * @param value the value to set. * @see #get() diff --git a/observable/src/main/java/io/github/mmm/value/observable/locale/ReadableLocaleValue.java b/observable/src/main/java/io/github/mmm/value/observable/locale/ReadableLocaleValue.java index 0c99e4c..3fece5b 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/locale/ReadableLocaleValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/locale/ReadableLocaleValue.java @@ -1,35 +1,40 @@ -/* 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.value.observable.locale; - -import java.util.Locale; - -import io.github.mmm.value.ReadableTypedValue; -import io.github.mmm.value.observable.object.ReadableSimpleValue; - -/** - * {@link ReadableTypedValue} with {@link Locale} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableLocaleValue extends ReadableSimpleValue { - - @Override - default String getAsString() { - - return getSafe().toString(); - } - - @Override - default Class getValueClass() { - - return Locale.class; - } - - @Override - default Locale getFallbackSafeValue() { - - return Locale.ROOT; - } - -} +/* 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.value.observable.locale; + +import java.util.Locale; + +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; + +/** + * {@link ReadableSimpleObjectValue} with {@link Locale} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableLocaleValue extends ReadableSimpleObjectValue { + + @Override + default String getAsString() { + + return getSafe().toString(); + } + + @Override + default Class getValueClass() { + + return Locale.class; + } + + @Override + default Locale getFallbackSafeValue() { + + return Locale.ROOT; + } + + @Override + default Locale parse(String value) { + + return Locale.forLanguageTag(value.replace('_', '-')); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/locale/WritableLocaleValue.java b/observable/src/main/java/io/github/mmm/value/observable/locale/WritableLocaleValue.java index e9d9adf..d99c281 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/locale/WritableLocaleValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/locale/WritableLocaleValue.java @@ -1,36 +1,30 @@ -/* 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.value.observable.locale; - -import java.util.Locale; - -import io.github.mmm.value.WritableValue; -import io.github.mmm.value.observable.object.WritableSimpleValue; - -/** - * {@link WritableValue} with {@link Locale} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface WritableLocaleValue extends WritableSimpleValue, ReadableLocaleValue { - - @Override - default Locale parse(String value) { - - return Locale.forLanguageTag(value.replace('_', '-')); - } - - @Override - void set(Locale value); - - /** - * @param value the value to set. - * @see #get() - * @see #set(Locale) - */ - default void setValue(Locale value) { - - set(value); - } - -} +/* 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.value.observable.locale; + +import java.util.Locale; + +import io.github.mmm.value.WritableValue; +import io.github.mmm.value.observable.object.WritableSimpleValue; + +/** + * {@link WritableValue} with {@link Locale} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface WritableLocaleValue extends WritableSimpleValue, ReadableLocaleValue { + + @Override + void set(Locale value); + + /** + * @param value the value to set. + * @see #get() + * @see #set(Locale) + */ + default void setValue(Locale value) { + + set(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/ReadableNumberValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/ReadableNumberValue.java index 87aaa21..61da36c 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/ReadableNumberValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/ReadableNumberValue.java @@ -2,11 +2,10 @@ * http://www.apache.org/licenses/LICENSE-2.0 */ package io.github.mmm.value.observable.number; -import io.github.mmm.value.ReadableTypedValue; import io.github.mmm.value.observable.object.ReadableSimpleValue; /** - * {@link ReadableTypedValue} with {@link Number} {@link #get() value}. + * {@link ReadableSimpleValue} with {@link Number} {@link #get() value}. * * @param type of the observable {@link #get() value}. * @since 1.0.0 diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/ReadableBigDecimalValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/ReadableBigDecimalValue.java index 82ae5ac..6d5a766 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/ReadableBigDecimalValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/ReadableBigDecimalValue.java @@ -1,28 +1,36 @@ -/* 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.value.observable.number.bigdecimal; - -import java.math.BigDecimal; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link ReadableNumberValue} with {@link BigDecimal} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableBigDecimalValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return BigDecimal.class; - } - - @Override - default BigDecimal getFallbackSafeValue() { - - return BigDecimal.ZERO; - } - -} +/* 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.value.observable.number.bigdecimal; + +import java.math.BigDecimal; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link ReadableNumberValue} with {@link BigDecimal} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableBigDecimalValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return BigDecimal.class; + } + + @Override + default BigDecimal getFallbackSafeValue() { + + return BigDecimal.ZERO; + } + + @Override + default BigDecimal parse(String value) { + + if (value == null) { + return null; + } + return new BigDecimal(value); + } +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/WritableBigDecimalValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/WritableBigDecimalValue.java index 763a69e..6bf7f1f 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/WritableBigDecimalValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/bigdecimal/WritableBigDecimalValue.java @@ -14,15 +14,6 @@ */ public interface WritableBigDecimalValue extends ReadableBigDecimalValue, WritableNumberValue { - @Override - default BigDecimal parse(String value) { - - if (value == null) { - return null; - } - return new BigDecimal(value); - } - @Override default void setValueAsNumber(Number value) { diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/ReadableBigIntegerValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/ReadableBigIntegerValue.java index 33a68df..dc23634 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/ReadableBigIntegerValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/ReadableBigIntegerValue.java @@ -1,28 +1,37 @@ -/* 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.value.observable.number.biginteger; - -import java.math.BigInteger; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link BigInteger} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableBigIntegerValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return BigInteger.class; - } - - @Override - default BigInteger getFallbackSafeValue() { - - return BigInteger.ZERO; - } - -} +/* 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.value.observable.number.biginteger; + +import java.math.BigInteger; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link BigInteger} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableBigIntegerValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return BigInteger.class; + } + + @Override + default BigInteger getFallbackSafeValue() { + + return BigInteger.ZERO; + } + + @Override + default BigInteger parse(String value) { + + if (value == null) { + return null; + } + return new BigInteger(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/WritableBigIntegerValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/WritableBigIntegerValue.java index 5d2b613..98808b7 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/WritableBigIntegerValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/biginteger/WritableBigIntegerValue.java @@ -14,15 +14,6 @@ */ public interface WritableBigIntegerValue extends ReadableBigIntegerValue, WritableNumberValue { - @Override - default BigInteger parse(String value) { - - if (value == null) { - return null; - } - return new BigInteger(value); - } - @Override default void setValueAsNumber(Number value) { diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/bytes/ReadableByteValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/bytes/ReadableByteValue.java index 898cba4..12eb6aa 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/bytes/ReadableByteValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/bytes/ReadableByteValue.java @@ -1,33 +1,43 @@ -/* 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.value.observable.number.bytes; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link ReadableNumberValue} with {@link Byte} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableByteValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return Byte.class; - } - - /** - * @return the current value as primitive. Will be {@code 0} if undefined. - */ - default byte getValue() { - - return byteValue(); - } - - @Override - default Byte getFallbackSafeValue() { - - return Byte.valueOf((byte) 0); - } -} +/* 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.value.observable.number.bytes; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link ReadableNumberValue} with {@link Byte} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableByteValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return Byte.class; + } + + /** + * @return the current value as primitive. Will be {@code 0} if undefined. + */ + default byte getValue() { + + return byteValue(); + } + + @Override + default Byte getFallbackSafeValue() { + + return Byte.valueOf((byte) 0); + } + + @Override + default Byte parse(String value) { + + if (value == null) { + return null; + } + return Byte.valueOf(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/bytes/WritableByteValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/bytes/WritableByteValue.java index 230360c..c705810 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/bytes/WritableByteValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/bytes/WritableByteValue.java @@ -11,15 +11,6 @@ */ public interface WritableByteValue extends ReadableByteValue, WritableNumberValue { - @Override - default Byte parse(String value) { - - if (value == null) { - return null; - } - return Byte.valueOf(value); - } - @Override void set(Byte value); diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/doubles/ReadableDoubleValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/doubles/ReadableDoubleValue.java index 8bf0d97..0d58eda 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/doubles/ReadableDoubleValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/doubles/ReadableDoubleValue.java @@ -1,33 +1,43 @@ -/* 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.value.observable.number.doubles; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link ReadableNumberValue} with {@link Double} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableDoubleValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return Double.class; - } - - /** - * @return the current value as primitive. Will be {@code 0} if undefined. - */ - default double getValue() { - - return doubleValue(); - } - - @Override - default Double getFallbackSafeValue() { - - return Double.valueOf(0); - } -} +/* 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.value.observable.number.doubles; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link ReadableNumberValue} with {@link Double} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableDoubleValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return Double.class; + } + + /** + * @return the current value as primitive. Will be {@code 0} if undefined. + */ + default double getValue() { + + return doubleValue(); + } + + @Override + default Double getFallbackSafeValue() { + + return Double.valueOf(0); + } + + @Override + default Double parse(String value) { + + if (value == null) { + return null; + } + return Double.valueOf(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/doubles/WritableDoubleValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/doubles/WritableDoubleValue.java index 3a6dc99..20b4345 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/doubles/WritableDoubleValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/doubles/WritableDoubleValue.java @@ -11,15 +11,6 @@ */ public interface WritableDoubleValue extends ReadableDoubleValue, WritableNumberValue { - @Override - default Double parse(String value) { - - if (value == null) { - return null; - } - return Double.valueOf(value); - } - @Override void set(Double value); diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/floats/ReadableFloatValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/floats/ReadableFloatValue.java index b470969..3707730 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/floats/ReadableFloatValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/floats/ReadableFloatValue.java @@ -1,33 +1,43 @@ -/* 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.value.observable.number.floats; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link ReadableNumberValue} with {@link Float} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableFloatValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return Float.class; - } - - /** - * @return the current value as primitive. Will be {@code 0} if undefined. - */ - default float getValue() { - - return floatValue(); - } - - @Override - default Float getFallbackSafeValue() { - - return Float.valueOf(0); - } -} +/* 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.value.observable.number.floats; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link ReadableNumberValue} with {@link Float} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableFloatValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return Float.class; + } + + /** + * @return the current value as primitive. Will be {@code 0} if undefined. + */ + default float getValue() { + + return floatValue(); + } + + @Override + default Float getFallbackSafeValue() { + + return Float.valueOf(0); + } + + @Override + default Float parse(String value) { + + if (value == null) { + return null; + } + return Float.valueOf(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/floats/WritableFloatValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/floats/WritableFloatValue.java index 6c02dc6..70c832a 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/floats/WritableFloatValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/floats/WritableFloatValue.java @@ -11,15 +11,6 @@ */ public interface WritableFloatValue extends ReadableFloatValue, WritableNumberValue { - @Override - default Float parse(String value) { - - if (value == null) { - return null; - } - return Float.valueOf(value); - } - @Override void set(Float value); diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/integers/ReadableIntegerValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/integers/ReadableIntegerValue.java index 1d2deaf..a364e7e 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/integers/ReadableIntegerValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/integers/ReadableIntegerValue.java @@ -1,33 +1,43 @@ -/* 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.value.observable.number.integers; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link ReadableNumberValue} with {@link Integer} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableIntegerValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return Integer.class; - } - - /** - * @return the current value as primitive. Will be {@code 0} if undefined. - */ - default int getValue() { - - return intValue(); - } - - @Override - default Integer getFallbackSafeValue() { - - return Integer.valueOf(0); - } -} +/* 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.value.observable.number.integers; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link ReadableNumberValue} with {@link Integer} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableIntegerValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return Integer.class; + } + + /** + * @return the current value as primitive. Will be {@code 0} if undefined. + */ + default int getValue() { + + return intValue(); + } + + @Override + default Integer getFallbackSafeValue() { + + return Integer.valueOf(0); + } + + @Override + default Integer parse(String value) { + + if (value == null) { + return null; + } + return Integer.valueOf(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/integers/WritableIntegerValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/integers/WritableIntegerValue.java index 15f09f9..b139b8d 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/integers/WritableIntegerValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/integers/WritableIntegerValue.java @@ -11,15 +11,6 @@ */ public interface WritableIntegerValue extends ReadableIntegerValue, WritableNumberValue { - @Override - default Integer parse(String value) { - - if (value == null) { - return null; - } - return Integer.valueOf(value); - } - @Override void set(Integer value); diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/longs/ReadableLongValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/longs/ReadableLongValue.java index 2b01270..d52f67d 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/longs/ReadableLongValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/longs/ReadableLongValue.java @@ -1,33 +1,42 @@ -/* 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.value.observable.number.longs; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link ReadableNumberValue} with {@link Long} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableLongValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return Long.class; - } - - /** - * @return the current value as primitive. Will be {@code 0} if undefined. - */ - default long getValue() { - - return longValue(); - } - - @Override - default Long getFallbackSafeValue() { - - return Long.valueOf(0); - } -} +/* 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.value.observable.number.longs; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link ReadableNumberValue} with {@link Long} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableLongValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return Long.class; + } + + /** + * @return the current value as primitive. Will be {@code 0} if undefined. + */ + default long getValue() { + + return longValue(); + } + + @Override + default Long getFallbackSafeValue() { + + return Long.valueOf(0); + } + + @Override + default Long parse(String value) { + + if (value == null) { + return null; + } + return Long.valueOf(value); + } +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/longs/WritableLongValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/longs/WritableLongValue.java index 74fa03e..3044933 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/longs/WritableLongValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/longs/WritableLongValue.java @@ -11,15 +11,6 @@ */ public interface WritableLongValue extends ReadableLongValue, WritableNumberValue { - @Override - default Long parse(String value) { - - if (value == null) { - return null; - } - return Long.valueOf(value); - } - @Override void set(Long value); diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/shorts/ReadableShortValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/shorts/ReadableShortValue.java index 1fd90ff..ffbf9ca 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/shorts/ReadableShortValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/shorts/ReadableShortValue.java @@ -1,33 +1,42 @@ -/* 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.value.observable.number.shorts; - -import io.github.mmm.value.observable.number.ReadableNumberValue; - -/** - * {@link ReadableNumberValue} with {@link Short} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableShortValue extends ReadableNumberValue { - - @Override - default Class getValueClass() { - - return Short.class; - } - - /** - * @return the current value as primitive. Will be {@code 0} if undefined. - */ - default short getValue() { - - return shortValue(); - } - - @Override - default Short getFallbackSafeValue() { - - return Short.valueOf((short) 0); - } -} +/* 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.value.observable.number.shorts; + +import io.github.mmm.value.observable.number.ReadableNumberValue; + +/** + * {@link ReadableNumberValue} with {@link Short} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableShortValue extends ReadableNumberValue { + + @Override + default Class getValueClass() { + + return Short.class; + } + + /** + * @return the current value as primitive. Will be {@code 0} if undefined. + */ + default short getValue() { + + return shortValue(); + } + + @Override + default Short getFallbackSafeValue() { + + return Short.valueOf((short) 0); + } + + @Override + default Short parse(String value) { + + if (value == null) { + return null; + } + return Short.valueOf(value); + } +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/number/shorts/WritableShortValue.java b/observable/src/main/java/io/github/mmm/value/observable/number/shorts/WritableShortValue.java index d6f6ab6..01541e4 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/number/shorts/WritableShortValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/number/shorts/WritableShortValue.java @@ -11,15 +11,6 @@ */ public interface WritableShortValue extends ReadableShortValue, WritableNumberValue { - @Override - default Short parse(String value) { - - if (value == null) { - return null; - } - return Short.valueOf(value); - } - @Override void set(Short value); diff --git a/observable/src/main/java/io/github/mmm/value/observable/object/ReadableSimpleObjectValue.java b/observable/src/main/java/io/github/mmm/value/observable/object/ReadableSimpleObjectValue.java new file mode 100644 index 0000000..18d35de --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/object/ReadableSimpleObjectValue.java @@ -0,0 +1,13 @@ +/* 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.value.observable.object; + +/** + * {@link ReadableSimpleValue} that is also a {@link ReadableObjectValue}. + * + * @param type of the {@link #get() value}. + * @since 1.0.0 + */ +public interface ReadableSimpleObjectValue extends ReadableSimpleValue, ReadableObjectValue { + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/object/ReadableSimpleValue.java b/observable/src/main/java/io/github/mmm/value/observable/object/ReadableSimpleValue.java index 1c299e9..ec10f09 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/object/ReadableSimpleValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/object/ReadableSimpleValue.java @@ -2,7 +2,6 @@ * http://www.apache.org/licenses/LICENSE-2.0 */ package io.github.mmm.value.observable.object; -import io.github.mmm.value.ReadableTypedValue; import io.github.mmm.value.ReadableValue; /** @@ -12,7 +11,13 @@ * @param type of the {@link #get() value}. * @since 1.0.0 */ -public interface ReadableSimpleValue extends ReadableTypedValue { +public interface ReadableSimpleValue extends ReadableValue { + + /** + * @param valueAsString the value as {@link String}. May be {@code null}. + * @return the parsed {@code value}. May be {@code null} (e.g. if the given {@link String} is {@code null}). + */ + V parse(String valueAsString); /** * @return the {@link #get() value} as {@link String}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/object/ReadableTypedObjectValue.java b/observable/src/main/java/io/github/mmm/value/observable/object/ReadableTypedObjectValue.java deleted file mode 100644 index 7c30c97..0000000 --- a/observable/src/main/java/io/github/mmm/value/observable/object/ReadableTypedObjectValue.java +++ /dev/null @@ -1,15 +0,0 @@ -/* 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.value.observable.object; - -import io.github.mmm.value.ReadableTypedValue; - -/** - * {@link ReadableObjectValue} that is also a {@link ReadableTypedValue}. - * - * @param type of the {@link #getValue() value}. - * @since 1.0.0 - */ -public interface ReadableTypedObjectValue extends ReadableTypedValue, ReadableObjectValue { - -} diff --git a/observable/src/main/java/io/github/mmm/value/observable/object/WritableSimpleObjectValue.java b/observable/src/main/java/io/github/mmm/value/observable/object/WritableSimpleObjectValue.java new file mode 100644 index 0000000..69d9716 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/object/WritableSimpleObjectValue.java @@ -0,0 +1,13 @@ +/* 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.value.observable.object; + +/** + * {@link WritableSimpleValue} that is also a {@link WritableObjectValue}. + * + * @param type of the {@link #get() value}. + * @since 1.0.0 + */ +public interface WritableSimpleObjectValue extends WritableSimpleValue, WritableObjectValue { + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/object/WritableSimpleValue.java b/observable/src/main/java/io/github/mmm/value/observable/object/WritableSimpleValue.java index 68cda05..005648e 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/object/WritableSimpleValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/object/WritableSimpleValue.java @@ -13,12 +13,6 @@ */ public interface WritableSimpleValue extends ReadableSimpleValue, WritableValue { - /** - * @param valueAsString the value as {@link String}. May be {@code null}. - * @return the parsed {@code value}. May be {@code null} (e.g. if the given {@link String} is {@code null}). - */ - V parse(String valueAsString); - /** * @param value */ diff --git a/observable/src/main/java/io/github/mmm/value/observable/pattern/ReadablePatternValue.java b/observable/src/main/java/io/github/mmm/value/observable/pattern/ReadablePatternValue.java index 457deda..85e420f 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/pattern/ReadablePatternValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/pattern/ReadablePatternValue.java @@ -1,52 +1,61 @@ -/* 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.value.observable.pattern; - -import java.util.regex.Pattern; - -import io.github.mmm.value.ReadableTypedValue; -import io.github.mmm.value.observable.object.ReadableSimpleValue; - -/** - * {@link ReadableTypedValue} with {@link Pattern} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadablePatternValue extends ReadableSimpleValue { - - /** @see #getFallbackSafeValue() */ - Pattern STATIC_SAFE_VALUE = Pattern.compile(""); - - @Override - default String getAsString() { - - Pattern p = get(); - if (p == null) { - return null; - } - return p.pattern(); - } - - @Override - default Class getValueClass() { - - return Pattern.class; - } - - /** - * Same as {@link #get()}. - * - * @return the current {@link #get() value}. - */ - default Pattern getValue() { - - return get(); - } - - @Override - default Pattern getFallbackSafeValue() { - - return STATIC_SAFE_VALUE; - } - -} +/* 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.value.observable.pattern; + +import java.util.regex.Pattern; + +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; + +/** + * {@link ReadableSimpleObjectValue} with {@link Pattern} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadablePatternValue extends ReadableSimpleObjectValue { + + /** @see #getFallbackSafeValue() */ + Pattern STATIC_SAFE_VALUE = Pattern.compile(""); + + @Override + default String getAsString() { + + Pattern p = get(); + if (p == null) { + return null; + } + return p.pattern(); + } + + @Override + default Class getValueClass() { + + return Pattern.class; + } + + /** + * Same as {@link #get()}. + * + * @return the current {@link #get() value}. + */ + @Override + default Pattern getValue() { + + return get(); + } + + @Override + default Pattern getFallbackSafeValue() { + + return STATIC_SAFE_VALUE; + } + + @Override + default Pattern parse(String value) { + + if (value == null) { + return null; + } + return Pattern.compile(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/pattern/WritablePatternValue.java b/observable/src/main/java/io/github/mmm/value/observable/pattern/WritablePatternValue.java index 168cc54..4481874 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/pattern/WritablePatternValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/pattern/WritablePatternValue.java @@ -14,15 +14,6 @@ */ public interface WritablePatternValue extends WritableSimpleValue, ReadablePatternValue { - @Override - default Pattern parse(String value) { - - if (value == null) { - return null; - } - return Pattern.compile(value); - } - /** * @param value the value to set. * @see #get() diff --git a/observable/src/main/java/io/github/mmm/value/observable/string/ReadableStringValue.java b/observable/src/main/java/io/github/mmm/value/observable/string/ReadableStringValue.java index c340404..fd52fd2 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/string/ReadableStringValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/string/ReadableStringValue.java @@ -1,43 +1,38 @@ -/* 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.value.observable.string; - -import io.github.mmm.value.ReadableTypedValue; -import io.github.mmm.value.observable.object.ReadableSimpleValue; - -/** - * {@link ReadableTypedValue} with {@link String} {@link #get() value}. - * - * @since 1.0.0 - */ -public interface ReadableStringValue extends ReadableSimpleValue { - - @Override - default String getAsString() { - - return get(); - } - - @Override - default Class getValueClass() { - - return String.class; - } - - /** - * Same as {@link #get()}. - * - * @return the current {@link #get() value}. - */ - default String getValue() { - - return get(); - } - - @Override - default String getFallbackSafeValue() { - - return ""; - } - -} +/* 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.value.observable.string; + +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; + +/** + * {@link ReadableSimpleObjectValue} with {@link String} {@link #get() value}. + * + * @since 1.0.0 + */ +public interface ReadableStringValue extends ReadableSimpleObjectValue { + + @Override + default String getAsString() { + + return get(); + } + + @Override + default Class getValueClass() { + + return String.class; + } + + @Override + default String getFallbackSafeValue() { + + return ""; + } + + @Override + default String parse(String value) { + + return value; + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/string/WritableStringValue.java b/observable/src/main/java/io/github/mmm/value/observable/string/WritableStringValue.java index 5b23ec1..515d322 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/string/WritableStringValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/string/WritableStringValue.java @@ -12,12 +12,6 @@ */ public interface WritableStringValue extends WritableSimpleValue, ReadableStringValue { - @Override - default String parse(String value) { - - return value; - } - @Override default void setAsString(String value) { diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/ObservableTemporalAmountValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/ObservableTemporalAmountValue.java similarity index 92% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/ObservableTemporalAmountValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/ObservableTemporalAmountValue.java index 2067a0c..01cfb7c 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/ObservableTemporalAmountValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/ObservableTemporalAmountValue.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import java.time.temporal.TemporalAmount; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/ObservableTemporalValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/ObservableTemporalValue.java similarity index 91% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/ObservableTemporalValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/ObservableTemporalValue.java index 39a4e92..8611f5d 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/ObservableTemporalValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/ObservableTemporalValue.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import java.time.temporal.Temporal; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/ReadableTemporalAmountValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/ReadableTemporalAmountValue.java similarity index 62% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/ReadableTemporalAmountValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/ReadableTemporalAmountValue.java index 1f2288b..725f307 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/ReadableTemporalAmountValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/ReadableTemporalAmountValue.java @@ -1,11 +1,10 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import java.time.temporal.TemporalAmount; -import io.github.mmm.value.observable.object.ReadableSimpleValue; -import io.github.mmm.value.observable.object.ReadableTypedObjectValue; +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; /** * {@link io.github.mmm.value.ReadableValue} containing a {@link TemporalAmount} {@link #getValue() value}. @@ -13,7 +12,6 @@ * @param type of the {@link #getValue() value}. * @since 1.0.0 */ -public interface ReadableTemporalAmountValue - extends ReadableTypedObjectValue, ReadableSimpleValue { +public interface ReadableTemporalAmountValue extends ReadableSimpleObjectValue { } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/ReadableTemporalValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/ReadableTemporalValue.java similarity index 63% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/ReadableTemporalValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/ReadableTemporalValue.java index 0010c2e..2ec21c0 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/ReadableTemporalValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/ReadableTemporalValue.java @@ -1,11 +1,10 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import java.time.temporal.Temporal; -import io.github.mmm.value.observable.object.ReadableSimpleValue; -import io.github.mmm.value.observable.object.ReadableTypedObjectValue; +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; /** * {@link io.github.mmm.value.ReadableValue} containing a {@link Temporal} {@link #getValue() value}. @@ -13,6 +12,6 @@ * @param type of the {@link #getValue() value}. * @since 1.0.0 */ -public interface ReadableTemporalValue extends ReadableTypedObjectValue, ReadableSimpleValue { +public interface ReadableTemporalValue extends ReadableSimpleObjectValue { } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/TemporalAmountExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/TemporalAmountExpression.java similarity index 91% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/TemporalAmountExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/TemporalAmountExpression.java index f3fa798..fb8757c 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/TemporalAmountExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/TemporalAmountExpression.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import io.github.mmm.value.observable.comparable.ComparableExpression; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/TemporalExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/TemporalExpression.java similarity index 94% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/TemporalExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/TemporalExpression.java index 38cb2d0..2c836dc 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/TemporalExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/TemporalExpression.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import io.github.mmm.value.observable.booleans.BooleanBinding; import io.github.mmm.value.observable.comparable.ComparableExpression; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/WritableTemporalAmountValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/WritableTemporalAmountValue.java similarity index 61% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/WritableTemporalAmountValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/WritableTemporalAmountValue.java index e9e81fc..536b5ed 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/WritableTemporalAmountValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/WritableTemporalAmountValue.java @@ -1,11 +1,10 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import java.time.temporal.TemporalAmount; -import io.github.mmm.value.observable.object.WritableObjectValue; -import io.github.mmm.value.observable.object.WritableSimpleValue; +import io.github.mmm.value.observable.object.WritableSimpleObjectValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link TemporalAmount} {@link #getValue() value}. @@ -14,6 +13,6 @@ * @since 1.0.0 */ public interface WritableTemporalAmountValue - extends ReadableTemporalAmountValue, WritableObjectValue, WritableSimpleValue { + extends ReadableTemporalAmountValue, WritableSimpleObjectValue { } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/WritableTemporalValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/WritableTemporalValue.java similarity index 92% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/WritableTemporalValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/WritableTemporalValue.java index 4b8019f..7d4c2f0 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/WritableTemporalValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/WritableTemporalValue.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal; +package io.github.mmm.value.observable.time; import java.time.temporal.Temporal; diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/ReadableDayOfWeekValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/ReadableDayOfWeekValue.java new file mode 100644 index 0000000..6175786 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/ReadableDayOfWeekValue.java @@ -0,0 +1,43 @@ +/* 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.value.observable.time.dayofweek; + +import java.time.DayOfWeek; +import java.util.Locale; + +import io.github.mmm.value.observable.enumeration.ReadableEnumValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link DayOfWeek} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableDayOfWeekValue extends ReadableEnumValue { + + @Override + default Class getValueClass() { + + return DayOfWeek.class; + } + + @Override + default DayOfWeek getFallbackSafeValue() { + + return null; + } + + @Override + default DayOfWeek parse(String value) { + + if (value == null) { + return null; + } + if (value.length() <= 1) { + int m = Integer.parseInt(value); + return DayOfWeek.of(m); + } else { + return DayOfWeek.valueOf(value.toUpperCase(Locale.ROOT)); + } + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/WritableDayOfWeekValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/WritableDayOfWeekValue.java new file mode 100644 index 0000000..4e2ad48 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/WritableDayOfWeekValue.java @@ -0,0 +1,16 @@ +/* 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.value.observable.time.dayofweek; + +import java.time.DayOfWeek; + +import io.github.mmm.value.observable.object.WritableSimpleObjectValue; + +/** + * {@link io.github.mmm.value.WritableValue} containing a {@link DayOfWeek} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface WritableDayOfWeekValue extends ReadableDayOfWeekValue, WritableSimpleObjectValue { + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/package-info.java new file mode 100644 index 0000000..8e19d86 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/dayofweek/package-info.java @@ -0,0 +1,6 @@ +/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 + * http://www.apache.org/licenses/LICENSE-2.0 */ +/** + * Contains value infrastructure for {@link java.time.DayOfWeek}. + */ +package io.github.mmm.value.observable.time.dayofweek; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/DurationBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/duration/DurationBinding.java similarity index 92% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/duration/DurationBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/duration/DurationBinding.java index 7f435a1..70b5222 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/DurationBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/duration/DurationBinding.java @@ -1,4 +1,4 @@ -package io.github.mmm.value.observable.temporal.duration; +package io.github.mmm.value.observable.time.duration; import java.time.Duration; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/DurationExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/duration/DurationExpression.java similarity index 65% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/duration/DurationExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/duration/DurationExpression.java index 4b9072c..b048944 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/DurationExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/duration/DurationExpression.java @@ -1,8 +1,8 @@ -package io.github.mmm.value.observable.temporal.duration; +package io.github.mmm.value.observable.time.duration; import java.time.Duration; -import io.github.mmm.value.observable.temporal.TemporalAmountExpression; +import io.github.mmm.value.observable.time.TemporalAmountExpression; /** * {@link TemporalAmountExpression} for {@link Duration} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/ObservableDurationValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/duration/ObservableDurationValue.java similarity index 75% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/duration/ObservableDurationValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/duration/ObservableDurationValue.java index 9c29828..09391f3 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/ObservableDurationValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/duration/ObservableDurationValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.duration; +package io.github.mmm.value.observable.time.duration; import java.time.Duration; -import io.github.mmm.value.observable.temporal.ObservableTemporalAmountValue; +import io.github.mmm.value.observable.time.ObservableTemporalAmountValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link Duration} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/ReadableDurationValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/duration/ReadableDurationValue.java similarity index 68% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/duration/ReadableDurationValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/duration/ReadableDurationValue.java index a9e248b..2624114 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/ReadableDurationValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/duration/ReadableDurationValue.java @@ -1,29 +1,38 @@ -/* 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.value.observable.temporal.duration; - -import java.time.Duration; -import java.time.Instant; - -import io.github.mmm.value.observable.temporal.ReadableTemporalAmountValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link Instant} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableDurationValue extends ReadableTemporalAmountValue { - - @Override - default Class getValueClass() { - - return Duration.class; - } - - @Override - default Duration getFallbackSafeValue() { - - return Duration.ZERO; - } - -} +/* 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.value.observable.time.duration; + +import java.time.Duration; +import java.time.Instant; + +import io.github.mmm.value.observable.time.ReadableTemporalAmountValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link Instant} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableDurationValue extends ReadableTemporalAmountValue { + + @Override + default Class getValueClass() { + + return Duration.class; + } + + @Override + default Duration getFallbackSafeValue() { + + return Duration.ZERO; + } + + @Override + default Duration parse(String value) { + + if (value == null) { + return null; + } + return Duration.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/WritableDurationValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/duration/WritableDurationValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/duration/WritableDurationValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/duration/WritableDurationValue.java index 094d870..d055952 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/duration/WritableDurationValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/duration/WritableDurationValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.duration; +package io.github.mmm.value.observable.time.duration; import java.time.Duration; -import io.github.mmm.value.observable.temporal.WritableTemporalAmountValue; +import io.github.mmm.value.observable.time.WritableTemporalAmountValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link Duration} {@link #getValue() value}. @@ -13,13 +13,4 @@ */ public interface WritableDurationValue extends ReadableDurationValue, WritableTemporalAmountValue { - @Override - default Duration parse(String value) { - - if (value == null) { - return null; - } - return Duration.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantBinding.java similarity index 92% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantBinding.java index f2b7f06..1336156 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantBinding.java @@ -1,4 +1,4 @@ -package io.github.mmm.value.observable.temporal.instant; +package io.github.mmm.value.observable.time.instant; import java.time.Instant; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantExpression.java similarity index 81% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantExpression.java index d96669f..a33eaaa 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantExpression.java @@ -1,9 +1,9 @@ -package io.github.mmm.value.observable.temporal.instant; +package io.github.mmm.value.observable.time.instant; import java.time.Instant; import io.github.mmm.value.observable.booleans.BooleanBinding; -import io.github.mmm.value.observable.temporal.TemporalExpression; +import io.github.mmm.value.observable.time.TemporalExpression; /** * {@link TemporalExpression} for {@link Instant} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantHelper.java b/observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantHelper.java similarity index 90% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantHelper.java rename to observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantHelper.java index 9e41500..d4cecee 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/InstantHelper.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/instant/InstantHelper.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.instant; +package io.github.mmm.value.observable.time.instant; import java.time.Instant; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/ObservableInstantValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/instant/ObservableInstantValue.java similarity index 75% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/instant/ObservableInstantValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/instant/ObservableInstantValue.java index cd9194f..d41c60e 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/ObservableInstantValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/instant/ObservableInstantValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.instant; +package io.github.mmm.value.observable.time.instant; import java.time.Instant; -import io.github.mmm.value.observable.temporal.ObservableTemporalValue; +import io.github.mmm.value.observable.time.ObservableTemporalValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link Instant} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/ReadableInstantValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/instant/ReadableInstantValue.java similarity index 67% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/instant/ReadableInstantValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/instant/ReadableInstantValue.java index 04da9f0..3d6fd22 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/ReadableInstantValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/instant/ReadableInstantValue.java @@ -1,28 +1,37 @@ -/* 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.value.observable.temporal.instant; - -import java.time.Instant; - -import io.github.mmm.value.observable.temporal.ReadableTemporalValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link Instant} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableInstantValue extends ReadableTemporalValue { - - @Override - default Class getValueClass() { - - return Instant.class; - } - - @Override - default Instant getFallbackSafeValue() { - - return Instant.MIN; - } - -} +/* 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.value.observable.time.instant; + +import java.time.Instant; + +import io.github.mmm.value.observable.time.ReadableTemporalValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link Instant} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableInstantValue extends ReadableTemporalValue { + + @Override + default Class getValueClass() { + + return Instant.class; + } + + @Override + default Instant getFallbackSafeValue() { + + return Instant.MIN; + } + + @Override + default Instant parse(String value) { + + if (value == null) { + return null; + } + return Instant.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/WritableInstantValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/instant/WritableInstantValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/instant/WritableInstantValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/instant/WritableInstantValue.java index 35a4782..c711831 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/WritableInstantValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/instant/WritableInstantValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.instant; +package io.github.mmm.value.observable.time.instant; import java.time.Instant; -import io.github.mmm.value.observable.temporal.WritableTemporalValue; +import io.github.mmm.value.observable.time.WritableTemporalValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link Instant} {@link #getValue() value}. @@ -13,13 +13,4 @@ */ public interface WritableInstantValue extends ReadableInstantValue, WritableTemporalValue { - @Override - default Instant parse(String value) { - - if (value == null) { - return null; - } - return Instant.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/instant/package-info.java similarity index 78% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/instant/package-info.java rename to observable/src/main/java/io/github/mmm/value/observable/time/instant/package-info.java index 98f97df..98b38c5 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/instant/package-info.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/instant/package-info.java @@ -3,4 +3,4 @@ /** * Contains value infrastructure for {@link java.time.Instant}. */ -package io.github.mmm.value.observable.temporal.instant; \ No newline at end of file +package io.github.mmm.value.observable.time.instant; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateBinding.java similarity index 93% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateBinding.java index 5e6b998..4f2c3b3 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateBinding.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.localdate; +package io.github.mmm.value.observable.time.localdate; import java.time.LocalDate; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateExpression.java similarity index 81% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateExpression.java index f300278..fd630d8 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateExpression.java @@ -1,9 +1,9 @@ -package io.github.mmm.value.observable.temporal.localdate; +package io.github.mmm.value.observable.time.localdate; import java.time.LocalDate; import io.github.mmm.value.observable.booleans.BooleanBinding; -import io.github.mmm.value.observable.temporal.TemporalExpression; +import io.github.mmm.value.observable.time.TemporalExpression; /** * {@link TemporalExpression} for {@link LocalDate} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateHelper.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateHelper.java similarity index 89% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateHelper.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateHelper.java index f0abe9b..7aefa1f 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/LocalDateHelper.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/LocalDateHelper.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.localdate; +package io.github.mmm.value.observable.time.localdate; import java.time.LocalDate; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/ObservableLocalDateValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/ObservableLocalDateValue.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/ObservableLocalDateValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdate/ObservableLocalDateValue.java index ef5f954..640aad6 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/ObservableLocalDateValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/ObservableLocalDateValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.localdate; +package io.github.mmm.value.observable.time.localdate; import java.time.LocalDate; -import io.github.mmm.value.observable.temporal.ObservableTemporalValue; +import io.github.mmm.value.observable.time.ObservableTemporalValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link LocalDate} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/ReadableLocalDateValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/ReadableLocalDateValue.java similarity index 67% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/ReadableLocalDateValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdate/ReadableLocalDateValue.java index dc57447..bd32acc 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/ReadableLocalDateValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/ReadableLocalDateValue.java @@ -1,28 +1,37 @@ -/* 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.value.observable.temporal.localdate; - -import java.time.LocalDate; - -import io.github.mmm.value.observable.temporal.ReadableTemporalValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link LocalDate} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableLocalDateValue extends ReadableTemporalValue { - - @Override - default Class getValueClass() { - - return LocalDate.class; - } - - @Override - default LocalDate getFallbackSafeValue() { - - return LocalDate.MIN; - } - -} +/* 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.value.observable.time.localdate; + +import java.time.LocalDate; + +import io.github.mmm.value.observable.time.ReadableTemporalValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link LocalDate} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableLocalDateValue extends ReadableTemporalValue { + + @Override + default Class getValueClass() { + + return LocalDate.class; + } + + @Override + default LocalDate getFallbackSafeValue() { + + return LocalDate.MIN; + } + + @Override + default LocalDate parse(String value) { + + if (value == null) { + return null; + } + return LocalDate.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/WritableLocalDateValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/WritableLocalDateValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/WritableLocalDateValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdate/WritableLocalDateValue.java index eba5cc1..aae3808 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/WritableLocalDateValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/WritableLocalDateValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.localdate; +package io.github.mmm.value.observable.time.localdate; import java.time.LocalDate; -import io.github.mmm.value.observable.temporal.WritableTemporalValue; +import io.github.mmm.value.observable.time.WritableTemporalValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link LocalDate} {@link #getValue() value}. @@ -13,13 +13,4 @@ */ public interface WritableLocalDateValue extends ReadableLocalDateValue, WritableTemporalValue { - @Override - default LocalDate parse(String value) { - - if (value == null) { - return null; - } - return LocalDate.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/package-info.java similarity index 77% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/package-info.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdate/package-info.java index 19e6f41..4617354 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdate/package-info.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdate/package-info.java @@ -3,4 +3,4 @@ /** * Contains value infrastructure for {@link java.time.LocalDate}. */ -package io.github.mmm.value.observable.temporal.localdate; \ No newline at end of file +package io.github.mmm.value.observable.time.localdate; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeBinding.java similarity index 93% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeBinding.java index 147032f..2eb93f7 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeBinding.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.localdatetime; +package io.github.mmm.value.observable.time.localdatetime; import java.time.LocalDateTime; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeExpression.java similarity index 84% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeExpression.java index ff6b38a..3af3e32 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeExpression.java @@ -1,11 +1,11 @@ /* 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.value.observable.temporal.localdatetime; +package io.github.mmm.value.observable.time.localdatetime; import java.time.LocalDateTime; import io.github.mmm.value.observable.booleans.BooleanBinding; -import io.github.mmm.value.observable.temporal.TemporalExpression; +import io.github.mmm.value.observable.time.TemporalExpression; /** * {@link TemporalExpression} for {@link LocalDateTime} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeHelper.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeHelper.java similarity index 89% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeHelper.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeHelper.java index a8cb16a..1361cf8 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/LocalDateTimeHelper.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/LocalDateTimeHelper.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.localdatetime; +package io.github.mmm.value.observable.time.localdatetime; import java.time.LocalDateTime; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/ObservableLocalDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/ObservableLocalDateTimeValue.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/ObservableLocalDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/ObservableLocalDateTimeValue.java index 5e3bbcc..112794c 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/ObservableLocalDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/ObservableLocalDateTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.localdatetime; +package io.github.mmm.value.observable.time.localdatetime; import java.time.LocalDateTime; -import io.github.mmm.value.observable.temporal.ObservableTemporalValue; +import io.github.mmm.value.observable.time.ObservableTemporalValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link LocalDateTime} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/ReadableLocalDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/ReadableLocalDateTimeValue.java similarity index 67% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/ReadableLocalDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/ReadableLocalDateTimeValue.java index 6b6a40a..ac6bba0 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/ReadableLocalDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/ReadableLocalDateTimeValue.java @@ -1,28 +1,37 @@ -/* 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.value.observable.temporal.localdatetime; - -import java.time.LocalDateTime; - -import io.github.mmm.value.observable.temporal.ReadableTemporalValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link LocalDateTime} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableLocalDateTimeValue extends ReadableTemporalValue { - - @Override - default Class getValueClass() { - - return LocalDateTime.class; - } - - @Override - default LocalDateTime getFallbackSafeValue() { - - return LocalDateTime.MIN; - } - -} +/* 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.value.observable.time.localdatetime; + +import java.time.LocalDateTime; + +import io.github.mmm.value.observable.time.ReadableTemporalValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link LocalDateTime} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableLocalDateTimeValue extends ReadableTemporalValue { + + @Override + default Class getValueClass() { + + return LocalDateTime.class; + } + + @Override + default LocalDateTime getFallbackSafeValue() { + + return LocalDateTime.MIN; + } + + @Override + default LocalDateTime parse(String value) { + + if (value == null) { + return null; + } + return LocalDateTime.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/WritableLocalDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/WritableLocalDateTimeValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/WritableLocalDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/WritableLocalDateTimeValue.java index cdaf9f3..36b8437 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/WritableLocalDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/WritableLocalDateTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.localdatetime; +package io.github.mmm.value.observable.time.localdatetime; import java.time.LocalDateTime; -import io.github.mmm.value.observable.temporal.WritableTemporalValue; +import io.github.mmm.value.observable.time.WritableTemporalValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link LocalDateTime} {@link #getValue() value}. @@ -13,13 +13,4 @@ */ public interface WritableLocalDateTimeValue extends ReadableLocalDateTimeValue, WritableTemporalValue { - @Override - default LocalDateTime parse(String value) { - - if (value == null) { - return null; - } - return LocalDateTime.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/package-info.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/package-info.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/package-info.java index b3419ec..062ee11 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localdatetime/package-info.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localdatetime/package-info.java @@ -3,4 +3,4 @@ /** * Contains value infrastructure for {@link java.time.LocalDateTime}. */ -package io.github.mmm.value.observable.temporal.localdatetime; \ No newline at end of file +package io.github.mmm.value.observable.time.localdatetime; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeBinding.java similarity index 93% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeBinding.java index 5cbff64..451c2af 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeBinding.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.localtime; +package io.github.mmm.value.observable.time.localtime; import java.time.LocalTime; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeExpression.java similarity index 84% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeExpression.java index b0369b5..ead40fa 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeExpression.java @@ -1,11 +1,11 @@ /* 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.value.observable.temporal.localtime; +package io.github.mmm.value.observable.time.localtime; import java.time.LocalTime; import io.github.mmm.value.observable.booleans.BooleanBinding; -import io.github.mmm.value.observable.temporal.TemporalExpression; +import io.github.mmm.value.observable.time.TemporalExpression; /** * {@link TemporalExpression} for {@link LocalTime} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeHelper.java b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeHelper.java similarity index 89% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeHelper.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeHelper.java index 4de87a8..3b84ca5 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/LocalTimeHelper.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/LocalTimeHelper.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.localtime; +package io.github.mmm.value.observable.time.localtime; import java.time.LocalTime; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/ObservableLocalTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/ObservableLocalTimeValue.java similarity index 77% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/ObservableLocalTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localtime/ObservableLocalTimeValue.java index 1697453..f285a5e 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/ObservableLocalTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/ObservableLocalTimeValue.java @@ -1,11 +1,11 @@ /* 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.value.observable.temporal.localtime; +package io.github.mmm.value.observable.time.localtime; import java.time.LocalDateTime; import java.time.LocalTime; -import io.github.mmm.value.observable.temporal.ObservableTemporalValue; +import io.github.mmm.value.observable.time.ObservableTemporalValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link LocalDateTime} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/ReadableLocalTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/ReadableLocalTimeValue.java similarity index 67% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/ReadableLocalTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localtime/ReadableLocalTimeValue.java index 71a3861..51ae3ba 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/ReadableLocalTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/ReadableLocalTimeValue.java @@ -1,28 +1,37 @@ -/* 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.value.observable.temporal.localtime; - -import java.time.LocalTime; - -import io.github.mmm.value.observable.temporal.ReadableTemporalValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link LocalTime} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableLocalTimeValue extends ReadableTemporalValue { - - @Override - default Class getValueClass() { - - return LocalTime.class; - } - - @Override - default LocalTime getFallbackSafeValue() { - - return LocalTime.MIN; - } - -} +/* 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.value.observable.time.localtime; + +import java.time.LocalTime; + +import io.github.mmm.value.observable.time.ReadableTemporalValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link LocalTime} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableLocalTimeValue extends ReadableTemporalValue { + + @Override + default Class getValueClass() { + + return LocalTime.class; + } + + @Override + default LocalTime getFallbackSafeValue() { + + return LocalTime.MIN; + } + + @Override + default LocalTime parse(String value) { + + if (value == null) { + return null; + } + return LocalTime.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/WritableLocalTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/WritableLocalTimeValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/WritableLocalTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localtime/WritableLocalTimeValue.java index d31dfb6..304ad2a 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/WritableLocalTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/WritableLocalTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.localtime; +package io.github.mmm.value.observable.time.localtime; import java.time.LocalTime; -import io.github.mmm.value.observable.temporal.WritableTemporalValue; +import io.github.mmm.value.observable.time.WritableTemporalValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link LocalTime} {@link #getValue() value}. @@ -13,13 +13,4 @@ */ public interface WritableLocalTimeValue extends ReadableLocalTimeValue, WritableTemporalValue { - @Override - default LocalTime parse(String value) { - - if (value == null) { - return null; - } - return LocalTime.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/package-info.java similarity index 77% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/package-info.java rename to observable/src/main/java/io/github/mmm/value/observable/time/localtime/package-info.java index ba55a35..60fe987 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/localtime/package-info.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/localtime/package-info.java @@ -3,4 +3,4 @@ /** * Contains value infrastructure for {@link java.time.LocalTime}. */ -package io.github.mmm.value.observable.temporal.localtime; \ No newline at end of file +package io.github.mmm.value.observable.time.localtime; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/month/ReadableMonthValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/month/ReadableMonthValue.java new file mode 100644 index 0000000..a904fbf --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/month/ReadableMonthValue.java @@ -0,0 +1,43 @@ +/* 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.value.observable.time.month; + +import java.time.Month; +import java.util.Locale; + +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link Month} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableMonthValue extends ReadableSimpleObjectValue { + + @Override + default Class getValueClass() { + + return Month.class; + } + + @Override + default Month getFallbackSafeValue() { + + return null; + } + + @Override + default Month parse(String value) { + + if (value == null) { + return null; + } + if (value.length() <= 2) { + int m = Integer.parseInt(value); + return Month.of(m); + } else { + return Month.valueOf(value.toUpperCase(Locale.ROOT)); + } + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/month/WritableMonthValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/month/WritableMonthValue.java new file mode 100644 index 0000000..cb5b5ce --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/month/WritableMonthValue.java @@ -0,0 +1,16 @@ +/* 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.value.observable.time.month; + +import java.time.Month; + +import io.github.mmm.value.observable.object.WritableSimpleObjectValue; + +/** + * {@link io.github.mmm.value.WritableValue} containing a {@link Month} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface WritableMonthValue extends ReadableMonthValue, WritableSimpleObjectValue { + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/month/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/month/package-info.java new file mode 100644 index 0000000..1c287f7 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/month/package-info.java @@ -0,0 +1,6 @@ +/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 + * http://www.apache.org/licenses/LICENSE-2.0 */ +/** + * Contains value infrastructure for {@link java.time.Month}. + */ +package io.github.mmm.value.observable.time.month; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/ObservableOffsetDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/ObservableOffsetDateTimeValue.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/ObservableOffsetDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/ObservableOffsetDateTimeValue.java index 73925e3..966dfd1 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/ObservableOffsetDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/ObservableOffsetDateTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.offsetdatetime; +package io.github.mmm.value.observable.time.offsetdatetime; import java.time.OffsetDateTime; -import io.github.mmm.value.observable.temporal.ObservableTemporalValue; +import io.github.mmm.value.observable.time.ObservableTemporalValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link OffsetDateTime} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeBinding.java similarity index 93% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeBinding.java index aee6a46..7be6884 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeBinding.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.offsetdatetime; +package io.github.mmm.value.observable.time.offsetdatetime; import java.time.OffsetDateTime; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeExpression.java similarity index 84% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeExpression.java index 0bbdeb2..7a22d21 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeExpression.java @@ -1,11 +1,11 @@ /* 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.value.observable.temporal.offsetdatetime; +package io.github.mmm.value.observable.time.offsetdatetime; import java.time.OffsetDateTime; import io.github.mmm.value.observable.booleans.BooleanBinding; -import io.github.mmm.value.observable.temporal.TemporalExpression; +import io.github.mmm.value.observable.time.TemporalExpression; /** * {@link TemporalExpression} for {@link OffsetDateTime} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeHelper.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeHelper.java similarity index 89% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeHelper.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeHelper.java index f7a481f..613cb2a 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/OffsetDateTimeHelper.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/OffsetDateTimeHelper.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.offsetdatetime; +package io.github.mmm.value.observable.time.offsetdatetime; import java.time.OffsetDateTime; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/ReadableOffsetDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/ReadableOffsetDateTimeValue.java similarity index 67% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/ReadableOffsetDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/ReadableOffsetDateTimeValue.java index a6752c9..a267f25 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/ReadableOffsetDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/ReadableOffsetDateTimeValue.java @@ -1,28 +1,37 @@ -/* 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.value.observable.temporal.offsetdatetime; - -import java.time.OffsetDateTime; - -import io.github.mmm.value.observable.temporal.ReadableTemporalValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link OffsetDateTime} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableOffsetDateTimeValue extends ReadableTemporalValue { - - @Override - default Class getValueClass() { - - return OffsetDateTime.class; - } - - @Override - default OffsetDateTime getFallbackSafeValue() { - - return OffsetDateTime.MIN; - } - -} +/* 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.value.observable.time.offsetdatetime; + +import java.time.OffsetDateTime; + +import io.github.mmm.value.observable.time.ReadableTemporalValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link OffsetDateTime} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableOffsetDateTimeValue extends ReadableTemporalValue { + + @Override + default Class getValueClass() { + + return OffsetDateTime.class; + } + + @Override + default OffsetDateTime getFallbackSafeValue() { + + return OffsetDateTime.MIN; + } + + @Override + default OffsetDateTime parse(String value) { + + if (value == null) { + return null; + } + return OffsetDateTime.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/WritableOffsetDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/WritableOffsetDateTimeValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/WritableOffsetDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/WritableOffsetDateTimeValue.java index 65e7c58..c515e0f 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/WritableOffsetDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/WritableOffsetDateTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.offsetdatetime; +package io.github.mmm.value.observable.time.offsetdatetime; import java.time.OffsetDateTime; -import io.github.mmm.value.observable.temporal.WritableTemporalValue; +import io.github.mmm.value.observable.time.WritableTemporalValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link OffsetDateTime} {@link #getValue() value}. @@ -14,13 +14,4 @@ public interface WritableOffsetDateTimeValue extends ReadableOffsetDateTimeValue, WritableTemporalValue { - @Override - default OffsetDateTime parse(String value) { - - if (value == null) { - return null; - } - return OffsetDateTime.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/package-info.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/package-info.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/package-info.java index cad3322..90cdc52 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsetdatetime/package-info.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsetdatetime/package-info.java @@ -3,4 +3,4 @@ /** * Contains value infrastructure for {@link java.time.OffsetDateTime}. */ -package io.github.mmm.value.observable.temporal.offsetdatetime; \ No newline at end of file +package io.github.mmm.value.observable.time.offsetdatetime; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/ObservableOffsetTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/ObservableOffsetTimeValue.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/ObservableOffsetTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsettime/ObservableOffsetTimeValue.java index f1f2d9e..01ac3c1 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/ObservableOffsetTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/ObservableOffsetTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.offsettime; +package io.github.mmm.value.observable.time.offsettime; import java.time.OffsetTime; -import io.github.mmm.value.observable.temporal.ObservableTemporalValue; +import io.github.mmm.value.observable.time.ObservableTemporalValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link OffsetTime} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetDateTimeBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetDateTimeBinding.java similarity index 93% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetDateTimeBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetDateTimeBinding.java index f778da8..2947a25 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetDateTimeBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetDateTimeBinding.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.offsettime; +package io.github.mmm.value.observable.time.offsettime; import java.time.OffsetTime; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetTimeExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetTimeExpression.java similarity index 85% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetTimeExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetTimeExpression.java index eac1b45..729243b 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetTimeExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetTimeExpression.java @@ -1,12 +1,12 @@ /* 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.value.observable.temporal.offsettime; +package io.github.mmm.value.observable.time.offsettime; import java.time.LocalDateTime; import java.time.OffsetTime; import io.github.mmm.value.observable.booleans.BooleanBinding; -import io.github.mmm.value.observable.temporal.TemporalExpression; +import io.github.mmm.value.observable.time.TemporalExpression; /** * {@link TemporalExpression} for {@link LocalDateTime} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetTimeHelper.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetTimeHelper.java similarity index 89% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetTimeHelper.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetTimeHelper.java index 6c20e90..fba2e70 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/OffsetTimeHelper.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/OffsetTimeHelper.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.offsettime; +package io.github.mmm.value.observable.time.offsettime; import java.time.OffsetTime; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/ReadableOffsetTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/ReadableOffsetTimeValue.java similarity index 67% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/ReadableOffsetTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsettime/ReadableOffsetTimeValue.java index 6851ca4..2a6e3ac 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/ReadableOffsetTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/ReadableOffsetTimeValue.java @@ -1,28 +1,37 @@ -/* 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.value.observable.temporal.offsettime; - -import java.time.OffsetTime; - -import io.github.mmm.value.observable.temporal.ReadableTemporalValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link OffsetTime} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableOffsetTimeValue extends ReadableTemporalValue { - - @Override - default Class getValueClass() { - - return OffsetTime.class; - } - - @Override - default OffsetTime getFallbackSafeValue() { - - return OffsetTime.MIN; - } - -} +/* 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.value.observable.time.offsettime; + +import java.time.OffsetTime; + +import io.github.mmm.value.observable.time.ReadableTemporalValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link OffsetTime} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableOffsetTimeValue extends ReadableTemporalValue { + + @Override + default Class getValueClass() { + + return OffsetTime.class; + } + + @Override + default OffsetTime getFallbackSafeValue() { + + return OffsetTime.MIN; + } + + @Override + default OffsetTime parse(String value) { + + if (value == null) { + return null; + } + return OffsetTime.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/WritableOffsetTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/WritableOffsetTimeValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/WritableOffsetTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsettime/WritableOffsetTimeValue.java index fe8501a..1ef3e21 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/WritableOffsetTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/WritableOffsetTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.offsettime; +package io.github.mmm.value.observable.time.offsettime; import java.time.OffsetTime; -import io.github.mmm.value.observable.temporal.WritableTemporalValue; +import io.github.mmm.value.observable.time.WritableTemporalValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link OffsetTime} {@link #getValue() value}. @@ -13,13 +13,4 @@ */ public interface WritableOffsetTimeValue extends ReadableOffsetTimeValue, WritableTemporalValue { - @Override - default OffsetTime parse(String value) { - - if (value == null) { - return null; - } - return OffsetTime.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/package-info.java similarity index 77% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/package-info.java rename to observable/src/main/java/io/github/mmm/value/observable/time/offsettime/package-info.java index 8464b02..d4025ea 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/offsettime/package-info.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/offsettime/package-info.java @@ -3,4 +3,4 @@ /** * Contains value infrastructure for {@link java.time.OffsetTime}. */ -package io.github.mmm.value.observable.temporal.offsettime; \ No newline at end of file +package io.github.mmm.value.observable.time.offsettime; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/year/ReadableYearValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/year/ReadableYearValue.java new file mode 100644 index 0000000..fb20a80 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/year/ReadableYearValue.java @@ -0,0 +1,38 @@ +/* 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.value.observable.time.year; + +import java.time.Instant; +import java.time.Year; + +import io.github.mmm.value.observable.object.ReadableSimpleObjectValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link Instant} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableYearValue extends ReadableSimpleObjectValue { + + @Override + default Class getValueClass() { + + return Year.class; + } + + @Override + default Year getFallbackSafeValue() { + + return Year.of(0); + } + + @Override + default Year parse(String value) { + + if (value == null) { + return null; + } + return Year.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/year/WritableYearValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/year/WritableYearValue.java new file mode 100644 index 0000000..1b3cb53 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/year/WritableYearValue.java @@ -0,0 +1,16 @@ +/* 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.value.observable.time.year; + +import java.time.Year; + +import io.github.mmm.value.observable.object.WritableSimpleObjectValue; + +/** + * {@link io.github.mmm.value.WritableValue} containing a {@link Year} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface WritableYearValue extends ReadableYearValue, WritableSimpleObjectValue { + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/time/year/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/year/package-info.java new file mode 100644 index 0000000..1cb9e18 --- /dev/null +++ b/observable/src/main/java/io/github/mmm/value/observable/time/year/package-info.java @@ -0,0 +1,6 @@ +/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 + * http://www.apache.org/licenses/LICENSE-2.0 */ +/** + * Contains value infrastructure for {@link java.time.Year}. + */ +package io.github.mmm.value.observable.time.year; \ No newline at end of file diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ObservableZonedDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ObservableZonedDateTimeValue.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ObservableZonedDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ObservableZonedDateTimeValue.java index d25aa1e..c8f99e9 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ObservableZonedDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ObservableZonedDateTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.zoneddatetime; +package io.github.mmm.value.observable.time.zoneddatetime; import java.time.ZonedDateTime; -import io.github.mmm.value.observable.temporal.ObservableTemporalValue; +import io.github.mmm.value.observable.time.ObservableTemporalValue; /** * {@link io.github.mmm.value.observable.ObservableValue} containing a {@link ZonedDateTime} {@link #getValue() value}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ReadableZonedDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ReadableZonedDateTimeValue.java similarity index 73% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ReadableZonedDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ReadableZonedDateTimeValue.java index bcbd5b1..f930e16 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ReadableZonedDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ReadableZonedDateTimeValue.java @@ -1,33 +1,42 @@ -/* 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.value.observable.temporal.zoneddatetime; - -import java.time.LocalDateTime; -import java.time.ZoneOffset; -import java.time.ZonedDateTime; - -import io.github.mmm.value.observable.temporal.ReadableTemporalValue; - -/** - * {@link io.github.mmm.value.ReadableValue} containing a {@link ZonedDateTime} {@link #getValue() value}. - * - * @since 1.0.0 - */ -public interface ReadableZonedDateTimeValue extends ReadableTemporalValue { - - /** @see #getFallbackSafeValue() */ - ZonedDateTime STATIC_SAFE_VALUE = ZonedDateTime.of(LocalDateTime.MIN, ZoneOffset.MIN); - - @Override - default Class getValueClass() { - - return ZonedDateTime.class; - } - - @Override - default ZonedDateTime getFallbackSafeValue() { - - return STATIC_SAFE_VALUE; - } - -} +/* 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.value.observable.time.zoneddatetime; + +import java.time.LocalDateTime; +import java.time.ZoneOffset; +import java.time.ZonedDateTime; + +import io.github.mmm.value.observable.time.ReadableTemporalValue; + +/** + * {@link io.github.mmm.value.ReadableValue} containing a {@link ZonedDateTime} {@link #getValue() value}. + * + * @since 1.0.0 + */ +public interface ReadableZonedDateTimeValue extends ReadableTemporalValue { + + /** @see #getFallbackSafeValue() */ + ZonedDateTime STATIC_SAFE_VALUE = ZonedDateTime.of(LocalDateTime.MIN, ZoneOffset.MIN); + + @Override + default Class getValueClass() { + + return ZonedDateTime.class; + } + + @Override + default ZonedDateTime getFallbackSafeValue() { + + return STATIC_SAFE_VALUE; + } + + @Override + default ZonedDateTime parse(String value) { + + if (value == null) { + return null; + } + return ZonedDateTime.parse(value); + } + +} diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/WritableZonedDateTimeValue.java b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/WritableZonedDateTimeValue.java similarity index 59% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/WritableZonedDateTimeValue.java rename to observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/WritableZonedDateTimeValue.java index 704c216..f112120 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/WritableZonedDateTimeValue.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/WritableZonedDateTimeValue.java @@ -1,10 +1,10 @@ /* 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.value.observable.temporal.zoneddatetime; +package io.github.mmm.value.observable.time.zoneddatetime; import java.time.ZonedDateTime; -import io.github.mmm.value.observable.temporal.WritableTemporalValue; +import io.github.mmm.value.observable.time.WritableTemporalValue; /** * {@link io.github.mmm.value.WritableValue} containing a {@link ZonedDateTime} {@link #getValue() value}. @@ -13,13 +13,4 @@ */ public interface WritableZonedDateTimeValue extends ReadableZonedDateTimeValue, WritableTemporalValue { - @Override - default ZonedDateTime parse(String value) { - - if (value == null) { - return null; - } - return ZonedDateTime.parse(value); - } - } diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeBinding.java b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeBinding.java similarity index 93% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeBinding.java rename to observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeBinding.java index 1471185..1e10490 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeBinding.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeBinding.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.zoneddatetime; +package io.github.mmm.value.observable.time.zoneddatetime; import java.time.ZonedDateTime; import java.util.function.Supplier; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeExpression.java b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeExpression.java similarity index 84% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeExpression.java rename to observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeExpression.java index 573342a..590bf99 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeExpression.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeExpression.java @@ -1,11 +1,11 @@ /* 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.value.observable.temporal.zoneddatetime; +package io.github.mmm.value.observable.time.zoneddatetime; import java.time.ZonedDateTime; import io.github.mmm.value.observable.booleans.BooleanBinding; -import io.github.mmm.value.observable.temporal.TemporalExpression; +import io.github.mmm.value.observable.time.TemporalExpression; /** * {@link TemporalExpression} for {@link ZonedDateTime} {@link #getValue() values}. diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeHelper.java b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeHelper.java similarity index 89% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeHelper.java rename to observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeHelper.java index 59075a0..aa19164 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/ZonedDateTimeHelper.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/ZonedDateTimeHelper.java @@ -1,6 +1,6 @@ /* 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.value.observable.temporal.zoneddatetime; +package io.github.mmm.value.observable.time.zoneddatetime; import java.time.ZonedDateTime; diff --git a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/package-info.java b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/package-info.java similarity index 76% rename from observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/package-info.java rename to observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/package-info.java index d116840..ab39338 100644 --- a/observable/src/main/java/io/github/mmm/value/observable/temporal/zoneddatetime/package-info.java +++ b/observable/src/main/java/io/github/mmm/value/observable/time/zoneddatetime/package-info.java @@ -3,4 +3,4 @@ /** * Contains value infrastructure for {@link java.time.ZonedDateTime}. */ -package io.github.mmm.value.observable.temporal.zoneddatetime; \ No newline at end of file +package io.github.mmm.value.observable.time.zoneddatetime; \ No newline at end of file diff --git a/observable/src/main/java/module-info.java b/observable/src/main/java/module-info.java index 40ccaa9..28a18ba 100644 --- a/observable/src/main/java/module-info.java +++ b/observable/src/main/java/module-info.java @@ -1,77 +1,83 @@ -/* - * Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 - * http://www.apache.org/licenses/LICENSE-2.0 - */ -/** - * Provides observable value API and implementation for standard Java types. - */ -module io.github.mmm.value.observable { - - requires transitive io.github.mmm.base; - - requires transitive io.github.mmm.value; - - requires transitive io.github.mmm.event; - - exports io.github.mmm.value.observable; - - exports io.github.mmm.value.observable.booleans; - - exports io.github.mmm.value.observable.comparable; - - exports io.github.mmm.value.observable.container; - - exports io.github.mmm.value.observable.container.collection; - - exports io.github.mmm.value.observable.container.list; - - exports io.github.mmm.value.observable.container.map; - - exports io.github.mmm.value.observable.container.set; - - exports io.github.mmm.value.observable.enumeration; - - exports io.github.mmm.value.observable.locale; - - exports io.github.mmm.value.observable.number; - - exports io.github.mmm.value.observable.number.bigdecimal; - - exports io.github.mmm.value.observable.number.biginteger; - - exports io.github.mmm.value.observable.number.bytes; - - exports io.github.mmm.value.observable.number.doubles; - - exports io.github.mmm.value.observable.number.floats; - - exports io.github.mmm.value.observable.number.integers; - - exports io.github.mmm.value.observable.number.longs; - - exports io.github.mmm.value.observable.number.shorts; - - exports io.github.mmm.value.observable.object; - - exports io.github.mmm.value.observable.pattern; - - exports io.github.mmm.value.observable.string; - - exports io.github.mmm.value.observable.temporal; - - exports io.github.mmm.value.observable.temporal.duration; - - exports io.github.mmm.value.observable.temporal.instant; - - exports io.github.mmm.value.observable.temporal.localdate; - - exports io.github.mmm.value.observable.temporal.localdatetime; - - exports io.github.mmm.value.observable.temporal.localtime; - - exports io.github.mmm.value.observable.temporal.offsetdatetime; - - exports io.github.mmm.value.observable.temporal.offsettime; - - exports io.github.mmm.value.observable.temporal.zoneddatetime; +/* + * Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + */ +/** + * Provides observable value API and implementation for standard Java types. + */ +module io.github.mmm.value.observable { + + requires transitive io.github.mmm.base; + + requires transitive io.github.mmm.value; + + requires transitive io.github.mmm.event; + + exports io.github.mmm.value.observable; + + exports io.github.mmm.value.observable.booleans; + + exports io.github.mmm.value.observable.comparable; + + exports io.github.mmm.value.observable.container; + + exports io.github.mmm.value.observable.container.collection; + + exports io.github.mmm.value.observable.container.list; + + exports io.github.mmm.value.observable.container.map; + + exports io.github.mmm.value.observable.container.set; + + exports io.github.mmm.value.observable.enumeration; + + exports io.github.mmm.value.observable.locale; + + exports io.github.mmm.value.observable.number; + + exports io.github.mmm.value.observable.number.bigdecimal; + + exports io.github.mmm.value.observable.number.biginteger; + + exports io.github.mmm.value.observable.number.bytes; + + exports io.github.mmm.value.observable.number.doubles; + + exports io.github.mmm.value.observable.number.floats; + + exports io.github.mmm.value.observable.number.integers; + + exports io.github.mmm.value.observable.number.longs; + + exports io.github.mmm.value.observable.number.shorts; + + exports io.github.mmm.value.observable.object; + + exports io.github.mmm.value.observable.pattern; + + exports io.github.mmm.value.observable.string; + + exports io.github.mmm.value.observable.time; + + exports io.github.mmm.value.observable.time.dayofweek; + + exports io.github.mmm.value.observable.time.duration; + + exports io.github.mmm.value.observable.time.instant; + + exports io.github.mmm.value.observable.time.localdate; + + exports io.github.mmm.value.observable.time.localdatetime; + + exports io.github.mmm.value.observable.time.localtime; + + exports io.github.mmm.value.observable.time.month; + + exports io.github.mmm.value.observable.time.offsetdatetime; + + exports io.github.mmm.value.observable.time.offsettime; + + exports io.github.mmm.value.observable.time.year; + + exports io.github.mmm.value.observable.time.zoneddatetime; } \ No newline at end of file