You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tamaya.apache.org by an...@apache.org on 2017/09/28 20:03:39 UTC

[03/12] incubator-tamaya git commit: TAMAYA-274: Moved to Java 8, added @FunctionalInterface annotations and java.time converters.

TAMAYA-274: Moved to Java 8, added @FunctionalInterface annotations and java.time converters.


Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/2278346a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/2278346a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/2278346a

Branch: refs/heads/master
Commit: 2278346a684cf6ef8dd12c8d4edef7631d45feaf
Parents: bbfee92
Author: anatole <an...@apache.org>
Authored: Tue Aug 8 21:45:49 2017 +0200
Committer: Anatole Tresch <an...@apache.org>
Committed: Thu Sep 28 21:52:11 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/tamaya/ConfigOperator.java  |  1 +
 .../java/org/apache/tamaya/ConfigQuery.java     |  1 +
 .../apache/tamaya/spi/PropertyConverter.java    |  3 ++
 .../org/apache/tamaya/spi/PropertyFilter.java   |  1 +
 .../tamaya/spi/PropertySourceProvider.java      |  1 +
 .../org/apache/tamaya/spi/PropertyValue.java    |  3 +-
 .../org/apache/tamaya/spi/ServiceContext.java   |  3 +-
 .../DefaultConfigurationContextBuilder.java     |  1 +
 .../core/internal/PropertySourceComparator.java |  2 +-
 .../internal/converters/DurationConverter.java  | 51 ++++++++++++++++++++
 .../internal/converters/LocalDateConverter.java | 49 +++++++++++++++++++
 .../converters/LocalDateTimeConverter.java      | 49 +++++++++++++++++++
 .../internal/converters/LocalTimeConverter.java | 49 +++++++++++++++++++
 .../converters/OffsetDateTimeConverter.java     | 50 +++++++++++++++++++
 .../converters/OffsetTimeConverter.java         | 50 +++++++++++++++++++
 .../org.apache.tamaya.spi.PropertyConverter     |  6 +++
 16 files changed, 316 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/api/src/main/java/org/apache/tamaya/ConfigOperator.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/ConfigOperator.java b/code/api/src/main/java/org/apache/tamaya/ConfigOperator.java
index 2144218..b14c155 100644
--- a/code/api/src/main/java/org/apache/tamaya/ConfigOperator.java
+++ b/code/api/src/main/java/org/apache/tamaya/ConfigOperator.java
@@ -23,6 +23,7 @@ package org.apache.tamaya;
  * to modell additional functionality and applying it to a given {@link org.apache.tamaya.Configuration} instance by calling
  * the {@link org.apache.tamaya.Configuration#with(org.apache.tamaya.ConfigOperator)} method.
  */
+@FunctionalInterface
 public interface ConfigOperator {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/api/src/main/java/org/apache/tamaya/ConfigQuery.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/ConfigQuery.java b/code/api/src/main/java/org/apache/tamaya/ConfigQuery.java
index 60e87bb..28b8b93 100644
--- a/code/api/src/main/java/org/apache/tamaya/ConfigQuery.java
+++ b/code/api/src/main/java/org/apache/tamaya/ConfigQuery.java
@@ -23,6 +23,7 @@ package org.apache.tamaya;
  * to model additional functionality and applying it to a given {@link Configuration} instance by
  * calling the {@link Configuration#query(ConfigQuery)} method.
  */
+@FunctionalInterface
 public interface ConfigQuery<T> {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java b/code/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java
index ef6e2ac..56ac5e6 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/PropertyConverter.java
@@ -19,6 +19,8 @@
 package org.apache.tamaya.spi;
 
 
+import jdk.nashorn.internal.objects.annotations.Function;
+
 /**
  * Interface for an property that converts a configured String into something else.
  * This is used for implementing type conversion from a property (String) to a certain target
@@ -26,6 +28,7 @@ package org.apache.tamaya.spi;
  * 
  * @param <T> the type of the type literal
  */
+@FunctionalInterface
 public interface PropertyConverter<T>{
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java b/code/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java
index 350bd73..3054496 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/PropertyFilter.java
@@ -25,6 +25,7 @@ package org.apache.tamaya.spi;
  * hereby is defined by the corresponding {@code @Priority} annotation.</p>
  * <p>Filters </p>
  */
+@FunctionalInterface
 public interface PropertyFilter {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java b/code/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java
index 79a8d98..3f7beea 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/PropertySourceProvider.java
@@ -34,6 +34,7 @@ import java.util.Collections;
  * {@link java.util.ServiceLoader} mechanism and must get registered via
  * META-INF/services/org.apache.tamaya.spi.PropertySourceProvider</p>
  */
+@FunctionalInterface
 public interface PropertySourceProvider {
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java b/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java
index d1a8b9c..c538de7 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/PropertyValue.java
@@ -74,7 +74,7 @@ public final class PropertyValue implements Serializable{
     /**
      * The source.
      * @return the source, which provided the value, not {@code null}.
-     * @see PropertySource#getName().
+     * @see PropertySource#getName() .
      */
     public String getSource() {
         return this.source;
@@ -116,6 +116,7 @@ public final class PropertyValue implements Serializable{
     /**
      * Creates a new builder instance.
      * @param key the key, not {@code null}.
+     * @param value the property value, not {@code null}.
      * @param source the source, typically the name of the {@link PropertySource}
      *               providing the value, not {@code null}.
      * @return a new builder instance.

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
----------------------------------------------------------------------
diff --git a/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java b/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
index ef6c0b9..9eb18e8 100644
--- a/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
+++ b/code/api/src/main/java/org/apache/tamaya/spi/ServiceContext.java
@@ -78,7 +78,7 @@ public interface ServiceContext {
      * @param resource the resource, not {@code null}.
      * @param cl the desired classloader context, if null, the current thread context classloader is used.
      * @return the resources found
-     * @throws IOException
+     * @throws IOException if load fails.
      */
     Enumeration<URL> getResources(String resource, ClassLoader cl) throws IOException;
 
@@ -88,7 +88,6 @@ public interface ServiceContext {
      * @param resource the resource, not {@code null}.
      * @param cl the desired classloader context, if null, the current thread context classloader is used.
      * @return the resource found, or {@code null}.
-     * @throws IOException
      */
     URL getResource(String resource, ClassLoader cl);
 }

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationContextBuilder.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationContextBuilder.java b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationContextBuilder.java
index f825614..f63e5bb 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationContextBuilder.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/DefaultConfigurationContextBuilder.java
@@ -73,6 +73,7 @@ public class DefaultConfigurationContextBuilder implements ConfigurationContextB
 
     /**
      * Creates a new builder instance.
+     * @param context the context to be used, not null.
      */
     public DefaultConfigurationContextBuilder(ConfigurationContext context) {
         this.propertyConverters.putAll(context.getPropertyConverters());

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java b/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
index 1f2e412..64e245d 100644
--- a/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/PropertySourceComparator.java
@@ -76,7 +76,7 @@ public class PropertySourceComparator implements Comparator<PropertySource>, Ser
      * <ol>
      *     <li>It evaluates the {@code String} value for {@link PropertySource#TAMAYA_ORDINAL} and tries
      *     to convert it to an {@code int} value, using {@link Integer#parseInt(String)}.</li>
-     *     <li>It tries to find and evaluate a method {@code int getOrdinal()}</li>.
+     *     <li>It tries to find and evaluate a method {@code int getOrdinal()}.</li>
      *     <li>It tries to find and evaluate a static field {@code int ORDINAL}.</li>
      *     <li>It tries to find an d evaluate a class level {@link Priority} annotation.</li>
      *     <li>It uses the default priority ({@code 0}.</li>

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
new file mode 100644
index 0000000..65086d8
--- /dev/null
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/DurationConverter.java
@@ -0,0 +1,51 @@
+/*
+ * 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.tamaya.core.internal.converters;
+
+import org.apache.tamaya.spi.ConversionContext;
+import org.apache.tamaya.spi.PropertyConverter;
+
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.util.logging.Logger;
+
+/**
+ * Converter, converting from String to Boolean.
+ */
+public class DurationConverter implements PropertyConverter<Duration> {
+
+    private final Logger LOG = Logger.getLogger(getClass().getName());
+
+    @Override
+    public Duration convert(String value, ConversionContext context) {
+        context.addSupportedFormats(getClass(),
+                Duration.of(1234, ChronoUnit.SECONDS).toString());
+        return Duration.parse(value);
+    }
+
+    @Override
+    public boolean equals(Object o){
+        return getClass().equals(o.getClass());
+    }
+
+    @Override
+    public int hashCode(){
+        return getClass().hashCode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
new file mode 100644
index 0000000..2ae8bef
--- /dev/null
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateConverter.java
@@ -0,0 +1,49 @@
+/*
+ * 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.tamaya.core.internal.converters;
+
+import org.apache.tamaya.spi.ConversionContext;
+import org.apache.tamaya.spi.PropertyConverter;
+
+import java.time.LocalDate;
+import java.util.logging.Logger;
+
+/**
+ * Converter, converting from String to Boolean.
+ */
+public class LocalDateConverter implements PropertyConverter<LocalDate> {
+
+    private final Logger LOG = Logger.getLogger(getClass().getName());
+
+    @Override
+    public LocalDate convert(String value, ConversionContext context) {
+        context.addSupportedFormats(getClass(), LocalDate.now().toString());
+        return LocalDate.parse(value);
+    }
+
+    @Override
+    public boolean equals(Object o){
+        return getClass().equals(o.getClass());
+    }
+
+    @Override
+    public int hashCode(){
+        return getClass().hashCode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
new file mode 100644
index 0000000..cdf6042
--- /dev/null
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalDateTimeConverter.java
@@ -0,0 +1,49 @@
+/*
+ * 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.tamaya.core.internal.converters;
+
+import org.apache.tamaya.spi.ConversionContext;
+import org.apache.tamaya.spi.PropertyConverter;
+
+import java.time.LocalDateTime;
+import java.util.logging.Logger;
+
+/**
+ * Converter, converting from String to Boolean.
+ */
+public class LocalDateTimeConverter implements PropertyConverter<LocalDateTime> {
+
+    private final Logger LOG = Logger.getLogger(getClass().getName());
+
+    @Override
+    public LocalDateTime convert(String value, ConversionContext context) {
+        context.addSupportedFormats(getClass(), LocalDateTime.now().toString());
+        return LocalDateTime.parse(value);
+    }
+
+    @Override
+    public boolean equals(Object o){
+        return getClass().equals(o.getClass());
+    }
+
+    @Override
+    public int hashCode(){
+        return getClass().hashCode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
new file mode 100644
index 0000000..e6e62a5
--- /dev/null
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/LocalTimeConverter.java
@@ -0,0 +1,49 @@
+/*
+ * 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.tamaya.core.internal.converters;
+
+import org.apache.tamaya.spi.ConversionContext;
+import org.apache.tamaya.spi.PropertyConverter;
+
+import java.time.LocalTime;
+import java.util.logging.Logger;
+
+/**
+ * Converter, converting from String to Boolean.
+ */
+public class LocalTimeConverter implements PropertyConverter<LocalTime> {
+
+    private final Logger LOG = Logger.getLogger(getClass().getName());
+
+    @Override
+    public LocalTime convert(String value, ConversionContext context) {
+        context.addSupportedFormats(getClass(), LocalTime.now().toString());
+        return LocalTime.parse(value);
+    }
+
+    @Override
+    public boolean equals(Object o){
+        return getClass().equals(o.getClass());
+    }
+
+    @Override
+    public int hashCode(){
+        return getClass().hashCode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
new file mode 100644
index 0000000..4bcf1ef
--- /dev/null
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetDateTimeConverter.java
@@ -0,0 +1,50 @@
+/*
+ * 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.tamaya.core.internal.converters;
+
+import org.apache.tamaya.spi.ConversionContext;
+import org.apache.tamaya.spi.PropertyConverter;
+
+import java.time.LocalDate;
+import java.time.OffsetDateTime;
+import java.util.logging.Logger;
+
+/**
+ * Converter, converting from String to Boolean.
+ */
+public class OffsetDateTimeConverter implements PropertyConverter<OffsetDateTime> {
+
+    private final Logger LOG = Logger.getLogger(getClass().getName());
+
+    @Override
+    public OffsetDateTime convert(String value, ConversionContext context) {
+        context.addSupportedFormats(getClass(), OffsetDateTime.now().toString());
+        return OffsetDateTime.parse(value);
+    }
+
+    @Override
+    public boolean equals(Object o){
+        return getClass().equals(o.getClass());
+    }
+
+    @Override
+    public int hashCode(){
+        return getClass().hashCode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
----------------------------------------------------------------------
diff --git a/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
new file mode 100644
index 0000000..eaaafc6
--- /dev/null
+++ b/code/core/src/main/java/org/apache/tamaya/core/internal/converters/OffsetTimeConverter.java
@@ -0,0 +1,50 @@
+/*
+ * 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.tamaya.core.internal.converters;
+
+import org.apache.tamaya.spi.ConversionContext;
+import org.apache.tamaya.spi.PropertyConverter;
+
+import java.time.OffsetDateTime;
+import java.time.OffsetTime;
+import java.util.logging.Logger;
+
+/**
+ * Converter, converting from String to Boolean.
+ */
+public class OffsetTimeConverter implements PropertyConverter<OffsetTime> {
+
+    private final Logger LOG = Logger.getLogger(getClass().getName());
+
+    @Override
+    public OffsetTime convert(String value, ConversionContext context) {
+        context.addSupportedFormats(getClass(), OffsetTime.now().toString());
+        return OffsetTime.parse(value);
+    }
+
+    @Override
+    public boolean equals(Object o){
+        return getClass().equals(o.getClass());
+    }
+
+    @Override
+    public int hashCode(){
+        return getClass().hashCode();
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/2278346a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
----------------------------------------------------------------------
diff --git a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
index 878e8a7..a53d80d 100644
--- a/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
+++ b/code/core/src/main/resources/META-INF/services/org.apache.tamaya.spi.PropertyConverter
@@ -33,3 +33,9 @@ org.apache.tamaya.core.internal.converters.URIConverter
 org.apache.tamaya.core.internal.converters.URLConverter
 org.apache.tamaya.core.internal.converters.FileConverter
 org.apache.tamaya.core.internal.converters.PathConverter
+org.apache.tamaya.core.internal.converters.DurationConverter
+org.apache.tamaya.core.internal.converters.LocalDateConverter
+org.apache.tamaya.core.internal.converters.LocalDateTimeConverter
+org.apache.tamaya.core.internal.converters.LocalTimeConverter
+org.apache.tamaya.core.internal.converters.OffsetDateTimeConverter
+org.apache.tamaya.core.internal.converters.OffsetTimeConverter