com.yandex.metrica
Class AdRevenue
java.lang.Object
com.yandex.metrica.AdRevenue
public class AdRevenue
extends java.lang.Object
The class to store Ad Revenue data.
The Ad Revenue object should be passed to the AppMetrica by using the YandexMetrica.reportAdRevenue(AdRevenue)
or IReporter.reportAdRevenue(AdRevenue)
method.
Nested Class Summary
Modifier and Type | Class and Description |
---|---|
static class | AdRevenue.Builder
Builder class for
AdRevenue objects. |
Field Summary
Modifier and Type | Field and Description |
---|---|
java.lang.String | adNetwork
Ad network.
|
java.lang.String | adPlacementId
Id of ad placement.
|
java.lang.String | adPlacementName
Name of ad placement.
|
java.math.BigDecimal | adRevenue
Amount of money received via ad revenue.
|
AdType | adType
Ad type.
|
java.lang.String | adUnitId
Id of ad unit.
|
java.lang.String | adUnitName
Name of ad unit.
|
java.util.Currency | currency
Currency in which money from `adRevenue` is represented.
|
java.util.Map<java.lang.String,java.lang.String> | payload
Arbitrary payload: additional info represented as key-value pairs.
|
java.lang.String | precision
Precision.
|
Method Summary
Modifier and Type | Method and Description |
---|---|
static AdRevenue.Builder | newBuilder(java.math.BigDecimal adRevenue, java.util.Currency currency)
Creates the new instance of
AdRevenue.Builder . |
static AdRevenue.Builder | newBuilder(double adRevenue, java.util.Currency currency)
Creates the new instance of
AdRevenue.Builder . |
static AdRevenue.Builder | newBuilder(long adRevenueMicros, java.util.Currency currency)
Creates the new instance of
AdRevenue.Builder . |
Field Detail
adRevenue
@NonNull public final java.math.BigDecimal adRevenue
Amount of money received via ad revenue. It cannot be negative.
currency
@NonNull public final java.util.Currency currency
Currency in which money from `adRevenue` is represented.
adNetwork
@Nullable public final java.lang.String adNetwork
Ad network. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica.
adUnitId
@Nullable public final java.lang.String adUnitId
Id of ad unit. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica.
adUnitName
@Nullable public final java.lang.String adUnitName
Name of ad unit. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica.
adPlacementId
@Nullable public final java.lang.String adPlacementId
Id of ad placement. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica.
adPlacementName
@Nullable public final java.lang.String adPlacementName
Name of ad placement. Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica.
precision
@Nullable public final java.lang.String precision
Precision. Example: "publisher_defined", "estimated". Maximum length is 100 symbols. If the value exceeds this limit it will be truncated by AppMetrica.
payload
@Nullable public final java.util.Map<java.lang.String,java.lang.String> payload
Arbitrary payload: additional info represented as key-value pairs. Maximum size is 30 KB. If the value exceeds this limit it will be truncated by AppMetrica.
Method Detail
newBuilder
public static AdRevenue.Builder newBuilder(@NonNull java.math.BigDecimal adRevenue, @NonNull java.util.Currency currency)
Creates the new instance of
AdRevenue.Builder
.- Parameters:
adRevenue
- Amount of money received via ad revenue.currency
- Currency.- Returns:
- new
AdRevenue.Builder
instance. - See Also:
adRevenue
,currency
newBuilder
public static AdRevenue.Builder newBuilder(long adRevenueMicros, @NonNull java.util.Currency currency)
Creates the new instance of
AdRevenue.Builder
.- Parameters:
adRevenueMicros
- Amount of money received via ad revenue represented as micros (actual value multiplied by 10^6). It will be converted toBigDecimal
.currency
- Currency.- Returns:
- new
AdRevenue.Builder
instance. - See Also:
adRevenue
,currency
newBuilder
public static AdRevenue.Builder newBuilder(double adRevenue, @NonNull java.util.Currency currency)
Creates the new instance of
AdRevenue.Builder
.- Parameters:
adRevenue
- Amount of money received via ad revenue represented as double. It will be converted toBigDecimal
. Note that for that purpose AppMetrica usesBigDecimal(double)
} constructor which can yield unpredictable results for values that cannot be precisely represented as double.currency
- Currency.- Returns:
- new
AdRevenue.Builder
instance. - See Also:
adRevenue
,currency