StartCheckoutEvent.java
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.crashlytics.android.answers;
import java.math.BigDecimal;
import java.util.Currency;
public class StartCheckoutEvent
extends PredefinedEvent<StartCheckoutEvent>
{
static final String CURRENCY_ATTRIBUTE = "currency";
static final String ITEM_COUNT_ATTRIBUTE = "itemCount";
static final BigDecimal MICRO_CONSTANT = BigDecimal.valueOf(1000000L);
static final String TOTAL_PRICE_ATTRIBUTE = "totalPrice";
static final String TYPE = "startCheckout";
String getPredefinedType()
{
return "startCheckout";
}
long priceToMicros(BigDecimal paramBigDecimal)
{
return MICRO_CONSTANT.multiply(paramBigDecimal).longValue();
}
public StartCheckoutEvent putCurrency(Currency paramCurrency)
{
if (!this.validator.isNull(paramCurrency, "currency")) {
this.predefinedAttributes.put("currency", paramCurrency.getCurrencyCode());
}
return this;
}
public StartCheckoutEvent putItemCount(int paramInt)
{
this.predefinedAttributes.put("itemCount", Integer.valueOf(paramInt));
return this;
}
public StartCheckoutEvent putTotalPrice(BigDecimal paramBigDecimal)
{
if (!this.validator.isNull(paramBigDecimal, "totalPrice")) {
this.predefinedAttributes.put("totalPrice", Long.valueOf(priceToMicros(paramBigDecimal)));
}
return this;
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/crashlytics/android/answers/StartCheckoutEvent.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/