launchers/crdt/src/main/java/io/activej/launchers/crdt/ConfigConverters.java
/**
	 * Config converter to create a {@link RendezvousPartitionScheme} out of a {@link Config}
	 * that is useful for creating {@link RpcStrategy} on a client side
	 *
	 * @return a config converter for {@link RendezvousPartitionScheme}
	 */
Config converter to create a  RendezvousPartitionScheme out of a  Config
that is useful for creating  RpcStrategy on a client side

@return a config converter for  RendezvousPartitionScheme
Config converter to create a RendezvousPartitionScheme out of a Config that is useful for creating RpcStrategy on a client side @return a config converter for RendezvousPartitionScheme
public static <P> ConfigConverter<RendezvousPartitionScheme<P>> ofRendezvousPartitionScheme(
			@NotNull ConfigConverter<P> partitionIdConverter
	) {
		return new ConfigConverter<>() {
			@Override
			public @NotNull RendezvousPartitionScheme<P> get(Config config) {
				Collection<Config> partitionGroupsConfig = config.getChild("partitionGroup").getChildren().values();
				List<RendezvousPartitionGroup<P>> partitionGroups = new ArrayList<>();
				for (Config partitionGroupConfig : partitionGroupsConfig) {
					partitionGroups.add(ofPartitionGroup(partitionIdConverter).get(partitionGroupConfig));
				}
				return RendezvousPartitionScheme.create(partitionGroups);
			}
			@Override
			@Contract("_, !null -> !null")
			public RendezvousPartitionScheme<P> get(Config config, @Nullable RendezvousPartitionScheme<P> defaultValue) {
				if (config.isEmpty()) {
					return defaultValue;
				} else {
					return get(config);
				}
			}
		};
	}
public static < P > ConfigConverter < RendezvousPartitionScheme < P > > ofRendezvousPartitionScheme ( @ NotNull ConfigConverter < P > partitionIdConverter ) { return new ConfigConverter < > ( ) { @ Override public @ NotNull RendezvousPartitionScheme < P > get ( Config config ) { Collection < Config > partitionGroupsConfig = config . getChild ( "partitionGroup" ) . getChildren ( ) . values ( ) ; List < RendezvousPartitionGroup < P > > partitionGroups = new ArrayList < > ( ) ; for ( Config partitionGroupConfig : partitionGroupsConfig ) { partitionGroups . add ( ofPartitionGroup ( partitionIdConverter ) . get ( partitionGroupConfig ) ) ; } return RendezvousPartitionScheme . create ( partitionGroups ) ; } @ Override @ Contract ( "_, !null -> !null" ) public RendezvousPartitionScheme < P > get ( Config config , @ Nullable RendezvousPartitionScheme < P > defaultValue ) { if ( config . isEmpty ( ) ) { return defaultValue ; } else { return get ( config ) ; } } } ; }
Config converter to create a {@link RendezvousPartitionScheme} out of a {@link Config}
 that is useful for creating {@link RpcStrategy} on a client side
Config converter to create a { @link RendezvousPartitionScheme } out of a { @link Config } that is useful for creating { @link RpcStrategy } on a client side