Repository: incubator-tamaya Updated Branches: refs/heads/configjsr 1478e6130 -> e56c7c979
Removed unused artifact. Signed-off-by: Anatole Tresch <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/commit/e56c7c97 Tree: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/tree/e56c7c97 Diff: http://git-wip-us.apache.org/repos/asf/incubator-tamaya/diff/e56c7c97 Branch: refs/heads/configjsr Commit: e56c7c9794bab21effdbfea437569d5afdde8004 Parents: 1478e61 Author: Anatole Tresch <[email protected]> Authored: Wed Jan 10 01:16:51 2018 +0100 Committer: Anatole Tresch <[email protected]> Committed: Wed Jan 10 01:16:51 2018 +0100 ---------------------------------------------------------------------- .../core/internal/converters/EntrySupplier.java | 95 ++++++++++++++++++++ 1 file changed, 95 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-tamaya/blob/e56c7c97/code/old/core/src/main/java/org/apache/tamaya/core/internal/converters/EntrySupplier.java ---------------------------------------------------------------------- diff --git a/code/old/core/src/main/java/org/apache/tamaya/core/internal/converters/EntrySupplier.java b/code/old/core/src/main/java/org/apache/tamaya/core/internal/converters/EntrySupplier.java new file mode 100644 index 0000000..9f718a4 --- /dev/null +++ b/code/old/core/src/main/java/org/apache/tamaya/core/internal/converters/EntrySupplier.java @@ -0,0 +1,95 @@ +///* +// * 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.*; +// +//import java.util.ArrayList; +//import java.util.List; +//import java.util.Objects; +//import java.util.function.Supplier; +//import java.util.logging.Level; +//import java.util.logging.Logger; +// +///** +// * Supplier implementation for a typed configuration entry. +// */ +//final class EntrySupplier<T> implements Supplier<T> { +// +// private static final Logger LOG = Logger.getLogger(EntrySupplier.class.getName()); +// +// private Supplier<Configuration> configSupplier; +// private List<String> keys = new ArrayList<>(); +// private String defaultValue; +// private TypeLiteral valueType; +// +// private EntrySupplier(Supplier<Configuration> configSupplier, +// List<String> keys, String defaultValue, TypeLiteral valueType){ +// this.configSupplier = Objects.requireNonNull(configSupplier); +// this.keys.addAll(Objects.requireNonNull(keys)); +// this.defaultValue = defaultValue; +// this.valueType = Objects.requireNonNull(valueType); +// } +// +// public Supplier<Configuration> getConfigSupplier() { +// return configSupplier; +// } +// +// public List<String> getKeys() { +// return keys; +// } +// +// public String getDefaultValue() { +// return defaultValue; +// } +// +// public TypeLiteral getValueType() { +// return valueType; +// } +// +// @Override +// public boolean equals(Object o) { +// return getClass().equals(o.getClass()); +// } +// +// @Override +// public int hashCode() { +// return getClass().hashCode(); +// } +// +// @Override +// public T get() { +// T result = null; +// for (String key : keys) { +// try { +// result = (T)configSupplier.get() +// .getOrDefault(key, valueType, null); +// if (result != null) { +// return result; +// } +// } catch (Exception e) { +// LOG.log(Level.FINE, "Cannot evaluate key '" + key + "' of type " + valueType, e); +// } +// } +// throw new ConfigException("Could not evaluate any config for of type " + valueType + +// " for keys: " + keys); +// } +// +// +//}
