class EmailAddressResolversImpl implements EmailAddressResolvers {

    @Override
    public DataFetcher<CompletableFuture<EmailAddress>> getEmailAddressDataFetcher() {
        return environment -> {
            long emailAddressId = util.getLongArg(environment, "emailAddressId");
            if (emailAddressId <= 0) {
                return null;
            }

            DataLoader<Long, EmailAddress> dataLoader = environment.getDataLoader(EmailAddressBatchLoader.KEY);
            return dataLoader.load(emailAddressId);
        };
    }

}