mirror of
https://github.com/google/nomulus
synced 2026-09-30 11:46:22 +00:00
Add methods to return subtypes of HistoryEntry when querying (#1172)
This is useful when we expect a specific subtype in the return value so that we can set the parent resource (e. g. DomainContent for DomainHistory) on it, or when a specific subtype is needed from the call site. This PR also fixes some use of generic return values. It is always better to return <HistoryEntry> than a wildcard <? extends HistoryEntry>, because for immutable collections, <? extends HistoryEntry> is no different than <HistoryEntry> as return value -- you can only get a HistoryEntry from it. The wildcard return value means that even if you are indeed getting a <DomainHistory> from the query, the call site has no compile time knowledge of it and can only assume it is a <HistoryEntry>. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/google/nomulus/1172) <!-- Reviewable:end -->
This commit is contained in:
@@ -120,6 +120,7 @@ ext {
|
||||
'jline:jline:1.0',
|
||||
'joda-time:joda-time:2.9.2',
|
||||
'junit:junit:4.13',
|
||||
'org.checkerframework:checker-qual:3.9.1',
|
||||
'org.junit.jupiter:junit-jupiter-api:5.6.2',
|
||||
'org.junit.jupiter:junit-jupiter-engine:5.6.2',
|
||||
'org.junit.jupiter:junit-jupiter-migrationsupport:5.6.2',
|
||||
|
||||
Reference in New Issue
Block a user