This is an automated email from the ASF dual-hosted git repository. desruisseaux pushed a commit to branch geoapi-3.1 in repository https://gitbox.apache.org/repos/asf/sis.git
commit adb5e5fd852c4c59d6fd2163a7044068f231a583 Merge: 776a5fd686 021b5413be Author: Martin Desruisseaux <martin.desruisse...@geomatys.com> AuthorDate: Thu May 9 15:37:08 2024 +0200 Merge branch 'geoapi-4.0' into geoapi-3.1. .../test/org/apache/sis/filter/PeriodLiteral.java | 2 +- .../org/apache/sis/metadata/iso/extent/DefaultTemporalExtent.java | 2 +- .../sis/metadata/iso/identification/AbstractIdentification.java | 2 +- .../sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java | 2 +- .../main/org/apache/sis/metadata/iso/maintenance/package-info.java | 2 ++ .../main/org/apache/sis/pending/temporal/DefaultPeriod.java | 2 +- .../main/org/apache/sis/pending/temporal/DefaultPeriodDuration.java | 6 ++++-- .../main/org/apache/sis/pending/temporal/Primitive.java | 2 +- .../main/org/apache/sis/pending/temporal/TemporalUtilities.java | 2 +- .../main/org/apache/sis/xml/bind/gml/TM_Primitive.java | 2 +- .../main/org/apache/sis/xml/bind/gml/TimeInstant.java | 4 +--- .../main/org/apache/sis/xml/bind/gml/TimePeriodBound.java | 4 +--- .../test/org/apache/sis/metadata/PropertyAccessorTest.java | 2 +- .../test/org/apache/sis/xml/bind/gml/TimePeriodTest.java | 4 +--- .../main/org/apache/sis/storage/base/MetadataBuilder.java | 2 +- 15 files changed, 19 insertions(+), 21 deletions(-) diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/identification/AbstractIdentification.java index a495ddccf2,f6d67b7bc1..b6c5e6587b --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/identification/AbstractIdentification.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/identification/AbstractIdentification.java @@@ -48,13 -49,12 +49,12 @@@ import org.apache.sis.xml.bind.metadata import org.apache.sis.xml.privy.LegacyNamespaces; import org.apache.sis.util.iso.Types; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.metadata.citation.ResponsibleParty; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: - import java.time.temporal.TemporalAmount; import org.opengis.metadata.identification.AssociatedResource; -// Specific to the geoapi-4.0 branch: -import org.opengis.metadata.citation.Responsibility; - /** * Basic information required to uniquely identify a resource or resources. diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java index dd275b64e4,49b810f795..422e4ad8e0 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/DefaultMaintenanceInformation.java @@@ -40,9 -39,6 +39,10 @@@ import org.apache.sis.xml.privy.LegacyN import org.apache.sis.util.privy.CollectionsExt; import static org.apache.sis.metadata.privy.ImplementationHelper.valueIfDefined; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.metadata.citation.ResponsibleParty; ++import org.opengis.temporal.PeriodDuration; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: import org.opengis.metadata.maintenance.Scope; diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/package-info.java index 3e90c57f02,e74ef43ba6..8a72822987 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/package-info.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/metadata/iso/maintenance/package-info.java @@@ -106,4 -104,6 +106,6 @@@ import org.apache.sis.xml.privy.LegacyN import org.apache.sis.xml.bind.gco.*; import org.apache.sis.xml.bind.metadata.*; import org.apache.sis.xml.bind.metadata.code.*; + -// Specific to the geoapi-4.0 branch: -import org.apache.sis.xml.bind.gts.TM_Duration; ++// Specific to the main and geoapi-3.1 branches: +import org.apache.sis.xml.bind.gts.TM_PeriodDuration; diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/pending/temporal/DefaultPeriodDuration.java index d513bc6608,0000000000..f384436080 mode 100644,000000..100644 --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/pending/temporal/DefaultPeriodDuration.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/pending/temporal/DefaultPeriodDuration.java @@@ -1,69 -1,0 +1,71 @@@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.sis.pending.temporal; + ++import java.time.temporal.TemporalAmount; ++import org.opengis.temporal.PeriodDuration; ++ ++// Specific to the geoapi-3.1 branch: +import java.util.List; +import java.io.Serializable; +import java.time.temporal.Temporal; - import java.time.temporal.TemporalAmount; +import java.time.temporal.TemporalUnit; - import org.opengis.temporal.PeriodDuration; + + +/** + * Default implementation of GeoAPI period duration. This is a temporary class; + * GeoAPI temporal interfaces are expected to change a lot in a future revision. + * + * @author Martin Desruisseaux (Geomatys) + */ +@SuppressWarnings("serial") +public final class DefaultPeriodDuration implements PeriodDuration, Serializable { + /** + * The temporal object providing the duration value. + */ + public final TemporalAmount duration; + + /** + * Creates a new duration. + */ + public DefaultPeriodDuration(final TemporalAmount duration) { + this.duration = duration; + } + + @Override public List<TemporalUnit> getUnits() {return duration.getUnits();} + @Override public long get (TemporalUnit unit) {return duration.get(unit);} + @Override public Temporal addTo (Temporal temporal) {return duration.addTo(temporal);} + @Override public Temporal subtractFrom(Temporal temporal) {return duration.subtractFrom(temporal);} + + /** String representation. */ + @Override public String toString() { + return duration.toString(); + } + + /** Hash code value of the time position. */ + @Override public int hashCode() { + return duration.hashCode() ^ 879337943; + } + + /** Compares with given object for equality. */ + @Override public boolean equals(final Object obj) { + if (obj instanceof DefaultPeriodDuration) { + duration.equals(((DefaultPeriodDuration) obj).duration); + } + return false; + } +} diff --cc endorsed/src/org.apache.sis.metadata/main/org/apache/sis/pending/temporal/Primitive.java index 9282f598a6,0a8220d48c..f85bd9f5cb --- a/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/pending/temporal/Primitive.java +++ b/endorsed/src/org.apache.sis.metadata/main/org/apache/sis/pending/temporal/Primitive.java @@@ -20,9 -21,8 +21,8 @@@ import org.opengis.temporal.RelativePos import org.opengis.temporal.TemporalGeometricPrimitive; import org.opengis.temporal.TemporalPrimitive; -// Specific to the geoapi-4.0 branch: -import org.opengis.metadata.Identifier; +// Specific to the geoapi-3.1 branch: - import java.time.temporal.TemporalAmount; +import org.opengis.referencing.ReferenceIdentifier; /** diff --cc endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyAccessorTest.java index 4425dfc907,1d0cf3aa69..229c4a6666 --- a/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyAccessorTest.java +++ b/endorsed/src/org.apache.sis.metadata/test/org/apache/sis/metadata/PropertyAccessorTest.java @@@ -62,12 -63,7 +63,11 @@@ import org.apache.sis.metadata.iso.cita import static org.apache.sis.test.TestUtilities.getSingleton; import static org.apache.sis.metadata.Assertions.assertTitleEquals; +// Specific to the main and geoapi-3.1 branches: +import org.opengis.metadata.citation.ResponsibleParty; +import org.opengis.referencing.ReferenceIdentifier; + // Specific to the geoapi-3.1 and geoapi-4.0 branches: - import java.time.temporal.TemporalAmount; import org.opengis.metadata.content.AttributeGroup; import org.opengis.referencing.ObjectDomain; import org.opengis.referencing.datum.DatumEnsemble;