Type-safe version of KeywordOption

Asked by Alexey Stukalov on 2008-11-17

Hi

I'm working on a new version of bzr4idea plugin. While working with bzr-java-lib, an idea came to me, that a type-safe version of KeywordOption may be of some use, i.e:

/**
 * @param <Type> type of option argument
 */
public class KeywordTypesafeOption<Type> extends Option {
...
}

It could be used, then, for example, in I[Cmd]Options options:
 public static final KeywordTypesafeOption<IBazaarRevisionSpec> REVISION = new KeywordOption("--revision", null); //$NON-NLS-N$

This would simplify client-calling code a bit and would provide some basic compile-time checks.

What do you think?

Question information

Language:
English Edit question
Status:
Answered
For:
Java library for Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
2008-11-17
Last reply:
2008-11-17

More type safety will be great... maybe create a branch and put these changes in it so that it can be publicly reviewed and commented on. Anything to get this project more used by other sources (i.e: bzr4idea) will be ideal.

Things to bear in mind:
I think Guillermo makes use of a script to generate these interfaces, so as to stay up to date with interface changes in bzrlib. I can't immediately say what the impact will be if generics are used. But it should be manageable.

Can you help with this problem?

Provide an answer of your own, or ask Alexey Stukalov for more information if necessary.

To post a message you must log in.