test_class.file: shardingsphere-infra/shardingsphere-infra-common/src/test/java/org/apache/shardingsphere/infra/yaml/swapper/YamlRuleConfigurationSwapperEngineTest.java
test_class.identifier: YamlRuleConfigurationSwapperEngineTest
test_case.body: @Test
      public void assertSwapToRuleConfigurations() {
          FixtureYamlRuleConfiguration yamlRuleConfig = new FixtureYamlRuleConfiguration();
          yamlRuleConfig.setName("test");
          Collection<RuleConfiguration> actual = new YamlRuleConfigurationSwapperEngine().swapToRuleConfigurations(Collections.singletonList(yamlRuleConfig));
          assertThat(actual.size(), is(1));
          assertThat(((FixtureRuleConfiguration) actual.iterator().next()).getName(), is("test"));
      }
test_case.class_method_signature: YamlRuleConfigurationSwapperEngineTest.assertSwapToRuleConfigurations()
test_case.full_signature: @Test public void assertSwapToRuleConfigurations()
test_case.identifier: assertSwapToRuleConfigurations
test_case.invocations: setName swapToRuleConfigurations singletonList assertThat size is assertThat getName next iterator is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertSwapToRuleConfigurations()
focal_class.file: shardingsphere-infra/shardingsphere-infra-common/src/main/java/org/apache/shardingsphere/infra/yaml/swapper/YamlRuleConfigurationSwapperEngine.java
focal_class.identifier: YamlRuleConfigurationSwapperEngine
focal_class.class_method_signature: YamlRuleConfigurationSwapperEngine.swapToYamlConfigurations(final Collection<RuleConfiguration> ruleConfigurations)
focal_class.full_signature: @SuppressWarnings("unchecked") public Collection<YamlRuleConfiguration> swapToYamlConfigurations(final Collection<RuleConfiguration> ruleConfigurations)
focal_class.identifier: swapToYamlConfigurations
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (final Collection<RuleConfiguration> ruleConfigurations)
focal_class.return: Collection<YamlRuleConfiguration>
focal_class.signature: Collection<YamlRuleConfiguration> swapToYamlConfigurations(final Collection<RuleConfiguration> ruleConfigurations)
focal_class.class_method_signature: YamlRuleConfigurationSwapperEngine.swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigs)
focal_class.full_signature: public Collection<RuleConfiguration> swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigs)
focal_class.identifier: swapToRuleConfigurations
focal_class.modifiers: public
focal_class.parameters: (final Collection<YamlRuleConfiguration> yamlRuleConfigs)
focal_class.return: Collection<RuleConfiguration>
focal_class.signature: Collection<RuleConfiguration> swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigs)
focal_class.class_method_signature: YamlRuleConfigurationSwapperEngine.swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigurations, 
                                                                     final Class<?> ruleConfigurationType, final YamlRuleConfigurationSwapper swapper)
focal_class.full_signature: @SuppressWarnings("unchecked") private Collection<RuleConfiguration> swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigurations, 
                                                                     final Class<?> ruleConfigurationType, final YamlRuleConfigurationSwapper swapper)
focal_class.identifier: swapToRuleConfigurations
focal_class.modifiers: @SuppressWarnings("unchecked") private
focal_class.parameters: (final Collection<YamlRuleConfiguration> yamlRuleConfigurations, 
                                                                     final Class<?> ruleConfigurationType, final YamlRuleConfigurationSwapper swapper)
focal_class.return: Collection<RuleConfiguration>
focal_class.signature: Collection<RuleConfiguration> swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigurations, 
                                                                     final Class<?> ruleConfigurationType, final YamlRuleConfigurationSwapper swapper)
focal_class.class_method_signature: YamlRuleConfigurationSwapperEngine.getYamlShortcuts()
focal_class.full_signature: @SneakyThrows(ReflectiveOperationException.class) public static Map<String, Class<?>> getYamlShortcuts()
focal_class.identifier: getYamlShortcuts
focal_class.modifiers: @SneakyThrows(ReflectiveOperationException.class) public static
focal_class.parameters: ()
focal_class.return: Map<String, Class<?>>
focal_class.signature: Map<String, Class<?>> getYamlShortcuts()
focal_method.body: public Collection<RuleConfiguration> swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigs) {
          Collection<RuleConfiguration> result = new LinkedList<>();
          Collection<Class<?>> ruleConfigurationTypes = yamlRuleConfigs.stream().map(YamlRuleConfiguration::getRuleConfigurationType).collect(Collectors.toList());
          for (Entry<Class<?>, YamlRuleConfigurationSwapper> entry : OrderedSPIRegistry.getRegisteredServicesByClass(ruleConfigurationTypes, YamlRuleConfigurationSwapper.class).entrySet()) {
              result.addAll(swapToRuleConfigurations(yamlRuleConfigs, entry.getKey(), entry.getValue()));
          }
          return result;
      }
focal_method.class_method_signature: YamlRuleConfigurationSwapperEngine.swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigs)
focal_method.full_signature: public Collection<RuleConfiguration> swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigs)
focal_method.identifier: swapToRuleConfigurations
focal_method.invocations: collect map stream toList entrySet getRegisteredServicesByClass addAll swapToRuleConfigurations getKey getValue
focal_method.modifiers: public
focal_method.parameters: (final Collection<YamlRuleConfiguration> yamlRuleConfigs)
focal_method.return: Collection<RuleConfiguration>
focal_method.signature: Collection<RuleConfiguration> swapToRuleConfigurations(final Collection<YamlRuleConfiguration> yamlRuleConfigs)