@Test void fromShouldReturnConfiguredEntry() throws Exception { XMLConfiguration configuration = FileConfigurationProvider.getConfig(new ByteArrayInputStream(( "<preDeletionHooks>" + " <preDeletionHook>" + " <class>a.class</class>" + " </preDeletionHook>" + "</preDeletionHooks>") .getBytes(StandardCharsets.UTF_8))); String className = "a.class"; assertThat(PreDeletionHooksConfiguration.from(configuration)) .isEqualTo(new PreDeletionHooksConfiguration(ImmutableList.of(PreDeletionHookConfiguration.forClass(className)))); }
public static PreDeletionHooksConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration) throws ConfigurationException { List<HierarchicalConfiguration<ImmutableNode>> entries = configuration.configurationsAt(CONFIGURATION_ENTRY_NAME); return new PreDeletionHooksConfiguration(entries .stream() .map(Throwing.function(PreDeletionHookConfiguration::from).sneakyThrow()) .collect(Guavate.toImmutableList())); }
PreDeletionHooksConfiguration { public static PreDeletionHooksConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration) throws ConfigurationException { List<HierarchicalConfiguration<ImmutableNode>> entries = configuration.configurationsAt(CONFIGURATION_ENTRY_NAME); return new PreDeletionHooksConfiguration(entries .stream() .map(Throwing.function(PreDeletionHookConfiguration::from).sneakyThrow()) .collect(Guavate.toImmutableList())); } }
PreDeletionHooksConfiguration { public static PreDeletionHooksConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration) throws ConfigurationException { List<HierarchicalConfiguration<ImmutableNode>> entries = configuration.configurationsAt(CONFIGURATION_ENTRY_NAME); return new PreDeletionHooksConfiguration(entries .stream() .map(Throwing.function(PreDeletionHookConfiguration::from).sneakyThrow()) .collect(Guavate.toImmutableList())); } @VisibleForTesting  PreDeletionHooksConfiguration(List<PreDeletionHookConfiguration> hooksConfiguration); }
PreDeletionHooksConfiguration { public static PreDeletionHooksConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration) throws ConfigurationException { List<HierarchicalConfiguration<ImmutableNode>> entries = configuration.configurationsAt(CONFIGURATION_ENTRY_NAME); return new PreDeletionHooksConfiguration(entries .stream() .map(Throwing.function(PreDeletionHookConfiguration::from).sneakyThrow()) .collect(Guavate.toImmutableList())); } @VisibleForTesting  PreDeletionHooksConfiguration(List<PreDeletionHookConfiguration> hooksConfiguration); static PreDeletionHooksConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration); static PreDeletionHooksConfiguration forHooks(PreDeletionHookConfiguration... hooks); static PreDeletionHooksConfiguration none(); List<PreDeletionHookConfiguration> getHooksConfiguration(); @Override final boolean equals(Object o); @Override final int hashCode(); }
PreDeletionHooksConfiguration { public static PreDeletionHooksConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration) throws ConfigurationException { List<HierarchicalConfiguration<ImmutableNode>> entries = configuration.configurationsAt(CONFIGURATION_ENTRY_NAME); return new PreDeletionHooksConfiguration(entries .stream() .map(Throwing.function(PreDeletionHookConfiguration::from).sneakyThrow()) .collect(Guavate.toImmutableList())); } @VisibleForTesting  PreDeletionHooksConfiguration(List<PreDeletionHookConfiguration> hooksConfiguration); static PreDeletionHooksConfiguration from(HierarchicalConfiguration<ImmutableNode> configuration); static PreDeletionHooksConfiguration forHooks(PreDeletionHookConfiguration... hooks); static PreDeletionHooksConfiguration none(); List<PreDeletionHookConfiguration> getHooksConfiguration(); @Override final boolean equals(Object o); @Override final int hashCode();  }