Last active
November 25, 2016 17:04
-
-
Save gunnarmorling/8ba0502c2772459186b5569863f45745 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Should we reject it? | |
public class DoubleExtractor implements ValueExtractor<Multimap<@ExtractedValue ?, @ExtractedValue ?>> { | |
@Override | |
public void extractValues(Multimap<?, ?> originalValue, ValueExtractor.ValueReceiver receiver) { | |
... | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface SameTypeForKeyAndValueMap<T> extends Map<T, T> {} | |
private SameTypeForKeyAndValueMap<@Valid String> stringToStringMap = ...; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private Map<String, @Valid Integer> intsByString; | |
public get Map<@Valid String, Integer> getIntsByString() { | |
return intsByString; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Some corner cases. What should happen in each of them?