test_class.declarator: collection = ShardingSphereServiceLoader.newServiceInstances(YamlRuleConfigurationSwapper.class)
test_class.modifier: private final
test_class.original_string: private final Collection<YamlRuleConfigurationSwapper> collection = ShardingSphereServiceLoader.newServiceInstances(YamlRuleConfigurationSwapper.class);
test_class.type: Collection<YamlRuleConfigurationSwapper>
test_class.var_name: collection
test_class.file: shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/test/java/org/apache/shardingsphere/replication/primaryreplica/yaml/swapper/PrimaryReplicaReplicationRuleConfigurationYamlSwapperTest.java
test_class.identifier: PrimaryReplicaReplicationRuleConfigurationYamlSwapperTest
test_case.body: @Test
      public void assertSwapToYamlWithLoadBalanceAlgorithm() {
          PrimaryReplicaReplicationDataSourceRuleConfiguration dataSourceConfig = 
                  new PrimaryReplicaReplicationDataSourceRuleConfiguration("ds", "primary", Collections.singletonList("replica"), "roundRobin");
          YamlPrimaryReplicaReplicationRuleConfiguration actual = getPrimaryReplicaReplicationRuleConfigurationYamlSwapper().swapToYamlConfiguration(new PrimaryReplicaReplicationRuleConfiguration(
                  Collections.singleton(dataSourceConfig), ImmutableMap.of("roundRobin", new ShardingSphereAlgorithmConfiguration("ROUND_ROBIN", new Properties()))));
          assertThat(actual.getDataSources().get("ds").getName(), is("ds"));
          assertThat(actual.getDataSources().get("ds").getPrimaryDataSourceName(), is("primary"));
          assertThat(actual.getDataSources().get("ds").getReplicaDataSourceNames(), is(Collections.singletonList("replica")));
          assertThat(actual.getDataSources().get("ds").getLoadBalancerName(), is("roundRobin"));
      }
test_case.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapperTest.assertSwapToYamlWithLoadBalanceAlgorithm()
test_case.full_signature: @Test public void assertSwapToYamlWithLoadBalanceAlgorithm()
test_case.identifier: assertSwapToYamlWithLoadBalanceAlgorithm
test_case.invocations: singletonList swapToYamlConfiguration getPrimaryReplicaReplicationRuleConfigurationYamlSwapper singleton of assertThat getName get getDataSources is assertThat getPrimaryDataSourceName get getDataSources is assertThat getReplicaDataSourceNames get getDataSources is singletonList assertThat getLoadBalancerName get getDataSources is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertSwapToYamlWithLoadBalanceAlgorithm()
focal_class.declarator: algorithmSwapper = new ShardingSphereAlgorithmConfigurationYamlSwapper()
focal_class.modifier: private final
focal_class.original_string: private final ShardingSphereAlgorithmConfigurationYamlSwapper algorithmSwapper = new ShardingSphereAlgorithmConfigurationYamlSwapper();
focal_class.type: ShardingSphereAlgorithmConfigurationYamlSwapper
focal_class.var_name: algorithmSwapper
focal_class.file: shardingsphere-features/shardingsphere-primary-replica-replication/shardingsphere-primary-replica-replication-common/src/main/java/org/apache/shardingsphere/replication/primaryreplica/yaml/swapper/PrimaryReplicaReplicationRuleConfigurationYamlSwapper.java
focal_class.identifier: PrimaryReplicaReplicationRuleConfigurationYamlSwapper
focal_class.interfaces: implements YamlRuleConfigurationSwapper<YamlPrimaryReplicaReplicationRuleConfiguration, PrimaryReplicaReplicationRuleConfiguration>
focal_class.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.swapToYamlConfiguration(final PrimaryReplicaReplicationRuleConfiguration data)
focal_class.full_signature: @Override public YamlPrimaryReplicaReplicationRuleConfiguration swapToYamlConfiguration(final PrimaryReplicaReplicationRuleConfiguration data)
focal_class.identifier: swapToYamlConfiguration
focal_class.modifiers: @Override public
focal_class.parameters: (final PrimaryReplicaReplicationRuleConfiguration data)
focal_class.return: YamlPrimaryReplicaReplicationRuleConfiguration
focal_class.signature: YamlPrimaryReplicaReplicationRuleConfiguration swapToYamlConfiguration(final PrimaryReplicaReplicationRuleConfiguration data)
focal_class.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.swapToYamlConfiguration(final PrimaryReplicaReplicationDataSourceRuleConfiguration dataSourceRuleConfig)
focal_class.full_signature: private YamlPrimaryReplicaReplicationDataSourceRuleConfiguration swapToYamlConfiguration(final PrimaryReplicaReplicationDataSourceRuleConfiguration dataSourceRuleConfig)
focal_class.identifier: swapToYamlConfiguration
focal_class.modifiers: private
focal_class.parameters: (final PrimaryReplicaReplicationDataSourceRuleConfiguration dataSourceRuleConfig)
focal_class.return: YamlPrimaryReplicaReplicationDataSourceRuleConfiguration
focal_class.signature: YamlPrimaryReplicaReplicationDataSourceRuleConfiguration swapToYamlConfiguration(final PrimaryReplicaReplicationDataSourceRuleConfiguration dataSourceRuleConfig)
focal_class.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.swapToObject(final YamlPrimaryReplicaReplicationRuleConfiguration yamlConfig)
focal_class.full_signature: @Override public PrimaryReplicaReplicationRuleConfiguration swapToObject(final YamlPrimaryReplicaReplicationRuleConfiguration yamlConfig)
focal_class.identifier: swapToObject
focal_class.modifiers: @Override public
focal_class.parameters: (final YamlPrimaryReplicaReplicationRuleConfiguration yamlConfig)
focal_class.return: PrimaryReplicaReplicationRuleConfiguration
focal_class.signature: PrimaryReplicaReplicationRuleConfiguration swapToObject(final YamlPrimaryReplicaReplicationRuleConfiguration yamlConfig)
focal_class.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.swapToObject(final String name, final YamlPrimaryReplicaReplicationDataSourceRuleConfiguration yamlDataSourceRuleConfig)
focal_class.full_signature: private PrimaryReplicaReplicationDataSourceRuleConfiguration swapToObject(final String name, final YamlPrimaryReplicaReplicationDataSourceRuleConfiguration yamlDataSourceRuleConfig)
focal_class.identifier: swapToObject
focal_class.modifiers: private
focal_class.parameters: (final String name, final YamlPrimaryReplicaReplicationDataSourceRuleConfiguration yamlDataSourceRuleConfig)
focal_class.return: PrimaryReplicaReplicationDataSourceRuleConfiguration
focal_class.signature: PrimaryReplicaReplicationDataSourceRuleConfiguration swapToObject(final String name, final YamlPrimaryReplicaReplicationDataSourceRuleConfiguration yamlDataSourceRuleConfig)
focal_class.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.getTypeClass()
focal_class.full_signature: @Override public Class<PrimaryReplicaReplicationRuleConfiguration> getTypeClass()
focal_class.identifier: getTypeClass
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Class<PrimaryReplicaReplicationRuleConfiguration>
focal_class.signature: Class<PrimaryReplicaReplicationRuleConfiguration> getTypeClass()
focal_class.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.getRuleTagName()
focal_class.full_signature: @Override public String getRuleTagName()
focal_class.identifier: getRuleTagName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getRuleTagName()
focal_class.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.getOrder()
focal_class.full_signature: @Override public int getOrder()
focal_class.identifier: getOrder
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: int
focal_class.signature: int getOrder()
focal_method.body: @Override
      public YamlPrimaryReplicaReplicationRuleConfiguration swapToYamlConfiguration(final PrimaryReplicaReplicationRuleConfiguration data) {
          YamlPrimaryReplicaReplicationRuleConfiguration result = new YamlPrimaryReplicaReplicationRuleConfiguration();
          result.setDataSources(data.getDataSources().stream().collect(
                  Collectors.toMap(PrimaryReplicaReplicationDataSourceRuleConfiguration::getName, this::swapToYamlConfiguration, (a, b) -> b, LinkedHashMap::new)));
          if (null != data.getLoadBalancers()) {
              data.getLoadBalancers().forEach((key, value) -> result.getLoadBalancers().put(key, algorithmSwapper.swapToYamlConfiguration(value)));
          }
          return result;
      }
focal_method.class_method_signature: PrimaryReplicaReplicationRuleConfigurationYamlSwapper.swapToYamlConfiguration(final PrimaryReplicaReplicationRuleConfiguration data)
focal_method.full_signature: @Override public YamlPrimaryReplicaReplicationRuleConfiguration swapToYamlConfiguration(final PrimaryReplicaReplicationRuleConfiguration data)
focal_method.identifier: swapToYamlConfiguration
focal_method.invocations: setDataSources collect stream getDataSources toMap getLoadBalancers forEach getLoadBalancers put getLoadBalancers swapToYamlConfiguration
focal_method.modifiers: @Override public
focal_method.parameters: (final PrimaryReplicaReplicationRuleConfiguration data)
focal_method.return: YamlPrimaryReplicaReplicationRuleConfiguration
focal_method.signature: YamlPrimaryReplicaReplicationRuleConfiguration swapToYamlConfiguration(final PrimaryReplicaReplicationRuleConfiguration data)