1 /*- 2 * #%L 3 * Secured Properties 4 * =============================================================== 5 * Copyright (C) 2016 - 2019 Brabenetz Harald, Austria 6 * =============================================================== 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * #L% 19 */ 20 package net.brabenetz.lib.securedproperties.config; 21 22 import java.io.File; 23 24 /** 25 * A Collection of known {@link ConfigInitializer} factory-methods. 26 */ 27 public final class ConfigInitializers { 28 29 private static final ConfigInitializer BY_SYSTEM_PROPERTIES_DEFAULT = new ConfigBySystemProperties(); 30 private static final ConfigInitializer BY_ENV_PROPERTIES_DEFAULT = new ConfigByEnvProperties(); 31 32 private ConfigInitializers() { 33 // hide constructor. 34 } 35 36 public static ConfigInitializer systemProperties() { 37 return BY_SYSTEM_PROPERTIES_DEFAULT; 38 } 39 40 public static ConfigInitializer envProperties() { 41 return BY_ENV_PROPERTIES_DEFAULT; 42 } 43 44 public static ConfigInitializer propertyFile(final File propertyFile) { 45 return new ConfigByPropertyFile(propertyFile); 46 } 47 }