All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.onepf.opfiab.samsung.model.SamsungPurchasedItem Maven / Gradle / Ivy

The newest version!
package org.onepf.opfiab.samsung.model;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import org.json.JSONException;
import org.onepf.opfiab.samsung.SamsungUtils;

import java.util.Date;

public class SamsungPurchasedItem extends SamsungBillingModel {

    private static final String KEY_SUBSCRIPTION_END_DATE = "mSubscriptionEndDate";


    @NonNull
    private final ItemType itemType;
    @Nullable
    private final Date subscriptionEndDate;

    public SamsungPurchasedItem(@NonNull final String originalJson) throws JSONException {
        super(originalJson);
        this.itemType = SamsungUtils.getItemType(jsonObject);

        final String dateString = jsonObject.optString(KEY_SUBSCRIPTION_END_DATE);
        this.subscriptionEndDate = SamsungUtils.parseDate(dateString);
    }

    @NonNull
    public ItemType getItemType() {
        return itemType;
    }

    @Nullable
    public Date getSubscriptionEndDate() {
        return subscriptionEndDate;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy