Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// Should we reject it?
public class DoubleExtractor implements ValueExtractor<Multimap<@ExtractedValue ?, @ExtractedValue ?>> {
@Override
public void extractValues(Multimap<?, ?> originalValue, ValueExtractor.ValueReceiver receiver) {
...
}
}
class ListValueExtractor implements ValueExtractor<List<@ExtractedValue ?>> {
...
}
class ArrayListValueExtractor implements ValueExtractor<ArrayList<@ExtractedValue ?>> {
...
}
// Which extractor should be applied? Constraint validator resolution is happening using the runtime type.
// Should the same be done for extractors? This wouldn't allow to cache it per usage, though.
private List<@Valid String> strings = new ArrayList<>();
interface SameTypeForKeyAndValueMap<T> extends Map<T, T> {}
private SameTypeForKeyAndValueMap<@Valid String> stringToStringMap = ...;
private Map<String, @Valid Integer> intsByString;
public get Map<@Valid String, Integer> getIntsByString() {
return intsByString;
}
@gunnarmorling

This comment has been minimized.

Copy link
Owner Author

@gunnarmorling gunnarmorling commented Nov 25, 2016

Some corner cases. What should happen in each of them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.