You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/12/04 09:55:14 UTC
[isis] 01/02: ISIS-2464: minor cleanup
This is an automated email from the ASF dual-hosted git repository.
ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git
commit bfb019818e035e3d62f027c49e5731faaf344fb5
Author: Andi Huber <ah...@apache.org>
AuthorDate: Fri Dec 4 10:44:57 2020 +0100
ISIS-2464: minor cleanup
---
.../org/apache/isis/applib/clock/VirtualClock.java | 10 ++++--
.../org/apache/isis/applib/clock/package-info.java | 42 ----------------------
2 files changed, 8 insertions(+), 44 deletions(-)
diff --git a/api/applib/src/main/java/org/apache/isis/applib/clock/VirtualClock.java b/api/applib/src/main/java/org/apache/isis/applib/clock/VirtualClock.java
index d32cbad..4e2dcc1 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/clock/VirtualClock.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/clock/VirtualClock.java
@@ -65,10 +65,16 @@ public interface VirtualClock extends Serializable {
// -- FACTORIES
+ /**
+ * Returns a the system's default ticking clock.
+ */
static VirtualClock system() {
return Instant::now;
}
+ /**
+ * Returns a ticking clock set to virtual time {@link Instant} {@code virtualNow}
+ */
static VirtualClock nowAt(@NonNull Instant virtualNow) {
// positive if the resulting clock is in the future
val offsetMillis = ChronoUnit.MILLIS.between(Instant.now(), virtualNow);
@@ -76,14 +82,14 @@ public interface VirtualClock extends Serializable {
}
/**
- * Always return the time as given {@link Instant} {@code frozenAt}
+ * Always returns the time {@link Instant} as given by {@code frozenAt}
*/
static VirtualClock frozenAt(@NonNull Instant frozenAt) {
return new VirtualClock_frozen(frozenAt);
}
/**
- * Always return the time as 2003/8/17 21:30:25
+ * Always returns the time {@link Instant} 2003/8/17 21:30:25 (UTC)
*/
static VirtualClock frozenTestClock() {
val frozenAt = Instant.from(
diff --git a/api/applib/src/main/java/org/apache/isis/applib/clock/package-info.java b/api/applib/src/main/java/org/apache/isis/applib/clock/package-info.java
deleted file mode 100644
index a38549c..0000000
--- a/api/applib/src/main/java/org/apache/isis/applib/clock/package-info.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-/**
- * Defines a {@link org.apache.isis.legacy.applib.clock.Clock} singleton
- * that can be used to obtain the current time.
- *
- * <p>
- * All of the built-in value types relating to time have
- * {@link org.apache.isis.applib.adapters.ValueSemanticsProvider#getDefaultsProvider() defaults}
- * that use the {@link org.apache.isis.legacy.applib.clock.Clock} singleton. For
- * consistency, domain objects and services should also use the Clock.
- *
- * <p>
- * Providing a clock is useful for testing, allowing the "current" time
- * to be placed under programmatic control (by {@link org.apache.isis.applib.fixtures.FixtureClock#initialize() initializing}
- * a {@link org.apache.isis.applib.fixtures.FixtureClock}. Otherwise though
- * the {@link org.apache.isis.legacy.applib.clock.Clock} just uses the time from the
- * current system.
- *
- * <p>
- * Note: this design also means that other {@link org.apache.isis.legacy.applib.clock.Clock}
- * implementations - such as a one that accesses the time from an NNTP time
- * daemon - could also be used.
- */
-package org.apache.isis.applib.clock;
\ No newline at end of file