コード例 #1
0
 static Method lookup(String method) {
   for (Method m : Method.values()) {
     if (m.toString().equalsIgnoreCase(method)) {
       return m;
     }
   }
   return null;
 }
コード例 #2
0
 public Sale(
     Integer purchaseId,
     String referenceNumber,
     DateTime soldDate,
     int m,
     String selectedShipping,
     Integer shippingPrice,
     int s,
     Member buyer,
     Integer quantitySold,
     Integer price,
     Integer subtotalPrice,
     Integer totalShippingPrice,
     Integer totalSalePrice,
     boolean hasSellerPlacedFeedback,
     boolean hasBuyerPlacedFeedback,
     boolean deliveryDetailsSent,
     Address deliveryAddress,
     String messageFromBuyer,
     String paymentInstructions,
     boolean hasPaidByCreditCard,
     DateTime creditCardPaymentDate,
     String creditCardType,
     String creditCardLastFourDigits,
     Integer orderId) {
   ShippingType = ShippingType.values()[s];
   Method = Method.values()[m];
   PurchaseId = purchaseId;
   ReferenceNumber = referenceNumber;
   SoldDate = soldDate;
   SelectedShipping = selectedShipping;
   ShippingPrice = shippingPrice;
   Buyer = buyer;
   QuantitySold = quantitySold;
   Price = price;
   SubtotalPrice = subtotalPrice;
   TotalShippingPrice = totalShippingPrice;
   TotalSalePrice = totalSalePrice;
   HasSellerPlacedFeedback = hasSellerPlacedFeedback;
   HasBuyerPlacedFeedback = hasBuyerPlacedFeedback;
   DeliveryDetailsSent = deliveryDetailsSent;
   DeliveryAddress = deliveryAddress;
   MessageFromBuyer = messageFromBuyer;
   PaymentInstructions = paymentInstructions;
   HasPaidByCreditCard = hasPaidByCreditCard;
   CreditCardPaymentDate = creditCardPaymentDate;
   CreditCardType = creditCardType;
   CreditCardLastFourDigits = creditCardLastFourDigits;
   OrderId = orderId;
 }
コード例 #3
0
 public void testMethodsThrowOnWrongThread() throws ExecutionException, InterruptedException {
   for (Method method : Method.values()) {
     assertTrue(methodWrongThread(method));
   }
 }