google-nomulus/java/google/registry/rdap
mcilwain 4491b7b909 Make loadByForeignKey() and related methods return Optional
This is safer and addresses a common source of confusion in the codebase because it's always explicit that the resource returned may not be present, whether because it's soft-deleted when projected to the given time or because it never existed in the first place.

In production code, the presence of the returned value is always checked. In test code, its presence is assumed using .get() where that is expected and convenient, as it not being present will throw an NPE that will cause the test to fail anyway.

Note that the roughly equivalent reloadResourceByForeignKey(), which is widely used in test code, is not having this same treatment applied to it. That is out of the scope of this CL, and has much smaller returns anyway because it's only used in tests (where the unexpected absence of a given resource would just cause the test to fail).

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=225424002
2018-12-14 11:24:49 -05:00
..
BUILD Clean up annotation imports in BUILD files 2018-06-27 15:28:53 -04:00
RdapActionBase.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
RdapAuthorization.java Allow admins read/write access to all registrar in web console 2018-10-22 19:08:09 -04:00
RdapAutnumAction.java Initial, easy changes to support later addition of RDAP metrics 2017-11-07 17:39:05 -05:00
RdapDomainAction.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
RdapDomainSearchAction.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
RdapEntityAction.java Centralize RDAP test initialization and login 2018-10-22 19:01:37 -04:00
RdapEntitySearchAction.java Centralize RDAP test initialization and login 2018-10-22 19:01:37 -04:00
RdapHelpAction.java Centralize RDAP test initialization and login 2018-10-22 19:01:37 -04:00
RdapIcannStandardInformation.java Move RDAP boilerplate from remarks to notices 2018-05-05 23:47:47 -04:00
RdapIpAction.java Initial, easy changes to support later addition of RDAP metrics 2017-11-07 17:39:05 -05:00
RdapJsonFormatter.java Centralize RDAP test initialization and login 2018-10-22 19:01:37 -04:00
RdapMetrics.java Move metrics dependencies to artifacts under Maven groupId com.google.monitoring-client 2018-01-04 17:12:35 -05:00
RdapModule.java Add RDAP search support for only contacts or only registrars 2018-01-19 14:29:54 -05:00
RdapNameserverAction.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
RdapNameserverSearchAction.java Make loadByForeignKey() and related methods return Optional 2018-12-14 11:24:49 -05:00
RdapResultSet.java Add RDAP metric class 2017-11-21 18:20:26 -05:00
RdapSearchActionBase.java Add next page navigation for RDAP entity searches 2017-12-27 10:53:30 -05:00
RdapSearchPattern.java RDAP: Allow domain and nameserver queries with no initial string under certain circumstances 2017-07-10 11:16:03 -04:00
RdapSearchResults.java Add next page navigation for RDAP nameserver searches 2017-12-27 10:44:05 -05:00
RdapUtils.java Switch from Guava Optionals to Java 8 Optionals 2017-10-24 16:53:47 -04:00