diff options
Diffstat (limited to 'sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl')
2 files changed, 17 insertions, 11 deletions
diff --git a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java index 7d2fe8f951..056becf435 100644 --- a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java +++ b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/ShoppingCartImpl.java @@ -21,21 +21,26 @@ package com.tuscanyscatours.impl; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
+
import com.tuscanyscatours.Checkout;
import com.tuscanyscatours.Updates;
public class ShoppingCartImpl implements Checkout, Updates {
- private static List<String> bookedTrips = new ArrayList<String>();
-
+ private static List<String> bookedTrips = new ArrayList<String>();
+
public void makePayment(BigDecimal amount, String cardInfo) {
- System.out.print("Charged $" + amount + " to card " + cardInfo + " for " +
- (bookedTrips.size() > 1 ? "trips" : "trip"));
- for (String trip : bookedTrips){
- System.out.print(" " + trip);
- }
- System.out.println();
- bookedTrips.clear();
+ System.out.print("Charged $" + amount
+ + " to card "
+ + cardInfo
+ + " for "
+ + (bookedTrips.size() > 1 ? "trips" : "trip"));
+ for (String trip : bookedTrips) {
+ System.out.print(" " + trip);
+ }
+ System.out.println();
+ bookedTrips.clear();
}
+
public void addTrip(String resCode) {
bookedTrips.add(resCode);
}
diff --git a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java index cd1573380c..f2884f87c5 100644 --- a/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java +++ b/sandbox/travelsample/contributions/introducing-tours/src/main/java/com/tuscanyscatours/impl/TripBookingImpl.java @@ -18,10 +18,11 @@ */
package com.tuscanyscatours.impl;
+import org.osoa.sca.annotations.Reference;
+
import com.goodvaluetrips.Trips;
import com.tuscanyscatours.Bookings;
import com.tuscanyscatours.Updates;
-import org.osoa.sca.annotations.Reference;
public class TripBookingImpl implements Bookings {
@Reference
@@ -29,7 +30,7 @@ public class TripBookingImpl implements Bookings { @Reference
protected Updates cart;
-
+
public String newBooking(String trip, int people) {
String resCode = mytrips.checkAvailability(trip, people);
cart.addTrip(resCode);
|