-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename API entry point #10
Comments
API entry class has been re-named as below (a non-backward compatible change) and pushed to the master branch. Usage example: TypeParser parser = TypeParser.newBuilder()
.setsplitStrategy(SplitStrategy)
.registerTypeParser(Class<?>, StringToTypeParser)
.registerTypeParserForTypesAssignableTo(Class<?>, StringToTypeParser)
.setInputPreprocessor(InputPreprocessor)
.build() Will be available in v0.2.0 |
Looks a lot better. Other possible changes: Still don't like StringToTypeParser even on the interface could it be renamed to just Parser? |
I was thinking the same about Which gives TypeParser parser = TypeParser.newBuilder()
.setsplitStrategy(SplitStrategy)
.registerParser(Class<?>, Parser)
.registerParserForTypesAssignableTo(Class<?>, Parser)
.setInputPreprocessor(InputPreprocessor)
.build() +1 from me |
Renaming the |
Nice. |
@Elisedlund suggested to change the API entry point from
StringToTypeParser
to something else. Since library is called type-parser it feels more intuitive to call the entry point TypeParser.However, the problem with that is: There already is an interface called TypeParser... so what to do?
There are a few suggestions:
ITypeParser
and renameStringToTypeParser
toTypeParser
TypeParser
interface toTypeParserHandler
and renameStringToTypeParser
toTypeParser
.StringToTypeParserBuilder
toTypeParserBuilder
.StringToTypeParserBuilder
toTypeParserFactory
.StringToTypeParser
toTypeParser
and renameTypeParser
toStringToTypeParser
.Any other suggestions?
I'm leaning towards the last one, with the motivation that the API entry is the actual usage (and visible in code), while the TypeParser interface will not be used at all by some (i.e. default TypeParser are enough). I.e. keep the most used as short/simple as possible.
Usage example:
The text was updated successfully, but these errors were encountered: