Skip to content

Conversation

@imagejan
Copy link
Member

@imagejan imagejan commented Nov 8, 2019

This PR closes #182 and adds AbstractDelegateConverter that allows to specify new converters that chain together two subsequent conversions like this:

@Plugin(type = Converter.class)
public class StringToDatasetConverter extends
	AbstractDelegateConverter<String, File, Dataset>
{

	@Override
	public Class<Dataset> getOutputType() {
		return Dataset.class;
	}

	@Override
	public Class<String> getInputType() {
		return String.class;
	}

	@Override
	protected Class<File> getDelegateType() {
		return File.class;
	}
}

I am not sure about how to implement the test: is it possible to create private nested classes that can be discovered as Plugins during test time?

I'd appreciate some advice here if you have time, @ctrueden.

EDIT: I think I figured it out. I force-pushed the latest commit, adding a test for the abstract class. This should now be ready for review.

Test coverage of the added classes: 100% 🙂

@imagejan imagejan force-pushed the delegate-converters branch from 62ba588 to d0268f9 Compare November 8, 2019 09:14
@imagejan imagejan marked this pull request as ready for review November 8, 2019 09:17
@imagejan imagejan requested a review from ctrueden November 8, 2019 09:17
@ctrueden
Copy link
Member

Cool, thanks a lot @imagejan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create delegate converter abstract class

3 participants