ConfigKeys { public static <T> BasicConfigKey.Builder<T,?> builder(Class<T> type) { return BasicConfigKey.builder(type); }  static ConfigKey<T> newConfigKey(Class<T> type, String name); static ConfigKey<T> newConfigKey(Class<T> type, String name, String description); static ConfigKey<T> newConfigKey(TypeToken<T> type, String name); static ConfigKey<T> newConfigKey(TypeToken<T> type, String name, String description); static ConfigKey<T> newConfigKey(Class<T> type, String name, String description, T defaultValue); static ConfigKey<T> newConfigKey(TypeToken<T> type, String name, String description, T defaultValue); static AttributeSensorAndConfigKey<T,T> newSensorAndConfigKey(Class<T> type, String name, String description); static AttributeSensorAndConfigKey<T,T> newSensorAndConfigKey(Class<T> type, String name, String description, T defaultValue); static AttributeSensorAndConfigKey<T,T> newSensorAndConfigKey(TypeToken<T> type, String name, String description); static AttributeSensorAndConfigKey<T,T> newSensorAndConfigKey(TypeToken<T> type, String name, String description, T defaultValue); static AttributeSensorAndConfigKey<String,String> newStringSensorAndConfigKey(String name, String description); static AttributeSensorAndConfigKey<String,String> newStringSensorAndConfigKey(String name, String description, String defaultValue); static AttributeSensorAndConfigKey<String,String> newTemplateSensorAndConfigKey(String name, String description); static AttributeSensorAndConfigKey<String,String> newTemplateSensorAndConfigKey(String name, String description, String defaultValue); static AttributeSensorAndConfigKey<Integer,Integer> newIntegerSensorAndConfigKey(String name, String description); static AttributeSensorAndConfigKey<Integer,Integer> newIntegerSensorAndConfigKey(String name, String description, Integer defaultValue); static PortAttributeSensorAndConfigKey newPortSensorAndConfigKey(String name, String description); static PortAttributeSensorAndConfigKey newPortSensorAndConfigKey(String name, String description, Object defaultValue); @SuppressWarnings({ "unchecked", "rawtypes" }) static ConfigKey<T> newConfigKey(String name, String description, @Nonnull T defaultValue); static BasicConfigKey.Builder<T,?> builder(Class<T> type); static BasicConfigKey.Builder<T,?> builder(TypeToken<T> type); static BasicConfigKey.Builder<T,?> builder(Class<T> type, String name); static BasicConfigKey.Builder<T,?> builder(TypeToken<T> type, String name); static ConfigKey<T> newConfigKeyWithDefault(ConfigKey<T> parent, T defaultValue); static ConfigKey<T> newConfigKeyWithDefault(ConfigKey<T> parent, String newDescription, T defaultValue); static AttributeSensorAndConfigKey<T, T> newSensorAndConfigKeyWithDefault(AttributeSensorAndConfigKey<T, T> parent, T defaultValue); static PortAttributeSensorAndConfigKey newPortSensorAndConfigKeyWithDefault(PortAttributeSensorAndConfigKey parent, Object defaultValue); @SuppressWarnings("unchecked") static ConfigKey<T> newConfigKeyRenamed(String newName, ConfigKey<T> key); static ConfigKey<T> newConfigKeyWithPrefix(String prefix, ConfigKey<T> key); static ConfigKey<T> newConfigKeyWithPrefixRemoved(String prefix, ConfigKey<T> key); static ConfigKey<T> convert(ConfigKey<T> key, CaseFormat inputCaseStrategy, CaseFormat outputCaseStrategy); static ConfigKey<String> newStringConfigKey(String name); static ConfigKey<String> newStringConfigKey(String name, String description); static ConfigKey<String> newStringConfigKey(String name, String description, String defaultValue); static ConfigKey<Integer> newIntegerConfigKey(String name); static ConfigKey<Integer> newIntegerConfigKey(String name, String description); static ConfigKey<Integer> newIntegerConfigKey(String name, String description, Integer defaultValue); static ConfigKey<Long> newLongConfigKey(String name); static ConfigKey<Long> newLongConfigKey(String name, String description); static ConfigKey<Long> newLongConfigKey(String name, String description, Long defaultValue); static ConfigKey<Double> newDoubleConfigKey(String name); static ConfigKey<Double> newDoubleConfigKey(String name, String description); static ConfigKey<Double> newDoubleConfigKey(String name, String description, Double defaultValue); static ConfigKey<Boolean> newBooleanConfigKey(String name); static ConfigKey<Boolean> newBooleanConfigKey(String name, String description); static ConfigKey<Boolean> newBooleanConfigKey(String name, String description, Boolean defaultValue); static ConfigKey<Duration> newDurationConfigKey(String name); static ConfigKey<Duration> newDurationConfigKey(String name, String description); static ConfigKey<Duration> newDurationConfigKey(String name, String description, Duration defaultValue);  }
@Test public void testConfigKeyBuilder() throws Exception { ConfigKey<String> key = ConfigKeys.builder(String.class, "mykey") .description("my descr") .defaultValue("my default val") .runtimeInheritance(BasicConfigInheritance.NOT_REINHERITED) .reconfigurable(true) .build(); checkMyKey(key); ConfigKey<String> key2 = BasicConfigKey.builder(key).build(); checkMyKey(key2); }