use of com.palantir.conjure.python.processors.packagename.PackageNameProcessor in project conjure-python by palantir.
the class ConjurePythonGenerator method buildPackageNameProcessor.
private PackageNameProcessor buildPackageNameProcessor() {
List<PackageNameProcessor> packageNameProcessors = new ArrayList<>();
packageNameProcessors.add(new TwoComponentStrippingPackageNameProcessor());
packageNameProcessors.addAll(config.pythonicPackageName().map(pythonPackageName -> ImmutableSet.of(new PrefixingPackageNameProcessor(pythonPackageName))).orElseGet(ImmutableSet::of));
packageNameProcessors.add(FlatteningPackageNameProcessor.INSTANCE);
return new CompoundPackageNameProcessor(packageNameProcessors);
}
use of com.palantir.conjure.python.processors.packagename.PackageNameProcessor in project conjure-python by palantir.
the class PackageNameProcessorTests method testFlatteningPackageNameProcessor.
@Test
public void testFlatteningPackageNameProcessor() {
PackageNameProcessor processor = new CompoundPackageNameProcessor(ImmutableList.of(FlatteningPackageNameProcessor.INSTANCE));
assertThat(processor.process("data.test.api")).isEqualTo("data_test_api");
}
Aggregations