Skip to content

Commit

Permalink
a reformat code
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Sep 12, 2024
1 parent e30d7c1 commit 48ca108
Showing 1 changed file with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,14 @@ private DataBase initializeDatabase()
return null;
}
}

class Step4 {
class Step4
{
// begin-snippet: step4
public void sendOutSeniorDiscounts(DataBase database, MailServer mailServer)
{
Loader<List<Customer>> seniorCustomerLoader = database::getSeniorCustomers;
sendOutSeniorDiscounts(mailServer, seniorCustomerLoader);
}

public void sendOutSeniorDiscounts(MailServer mailServer, Loader<List<Customer>> seniorCustomerLoader)
{
List<Customer> seniorCustomers = seniorCustomerLoader.load();
Expand All @@ -166,15 +165,14 @@ public void sendOutSeniorDiscounts(MailServer mailServer, Loader<List<Customer>>
}
// end-snippet
}

class Step4_a {
class Step4_a
{
// begin-snippet: step4
public void sendOutSeniorDiscounts(DataBase database, MailServer mailServer)
{
Loader<List<Customer>> seniorCustomerLoader = database::getSeniorCustomers;
sendOutSeniorDiscounts(mailServer, seniorCustomerLoader); // *
}

public void sendOutSeniorDiscounts(MailServer mailServer, Loader<List<Customer>> seniorCustomerLoader) // *
{
List<Customer> seniorCustomers = seniorCustomerLoader.load();
Expand All @@ -187,16 +185,17 @@ public void sendOutSeniorDiscounts(MailServer mailServer, Loader<List<Customer>>
}
// end-snippet
}
class Step4_b {
class Step4_b
{
// begin-snippet: step4_b
public void sendOutSeniorDiscounts(DataBase database, MailServer mailServer)
{
Loader<List<Customer>> seniorCustomerLoader = database::getSeniorCustomers;
Saver<Tuple<Customer, String>> mailSaver = Saver2.create(mailServer::sendMessage); // +
sendOutSeniorDiscounts(mailSaver, seniorCustomerLoader); // *
}

public void sendOutSeniorDiscounts(Saver<Tuple<Customer, String>> mailSaver, Loader<List<Customer>> seniorCustomerLoader) // *
public void sendOutSeniorDiscounts(Saver<Tuple<Customer, String>> mailSaver,
Loader<List<Customer>> seniorCustomerLoader) // *
{
List<Customer> seniorCustomers = seniorCustomerLoader.load();
for (Customer customer : seniorCustomers)
Expand Down Expand Up @@ -249,5 +248,4 @@ public String toString()
private class Discount
{
}

}

0 comments on commit 48ca108

Please sign in to comment.