LicenseImpl.java 1.48 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.day.downloadid.Checker
 */
package com.adobe.granite.license.impl;

import com.adobe.granite.license.License;
import com.day.downloadid.Checker;
import java.util.HashMap;
import java.util.Map;

/*
 * This class specifies class file version 49.0 but uses Java 6 signatures.  Assumed Java 6.
 */
public final class LicenseImpl
extends HashMap<String, String>
implements License {
    private static final long serialVersionUID = 5975434929952091131L;

    public static License createLicense(Map<String, String> props) {
        LicenseImpl lic = new LicenseImpl(props);
        if (lic.isValid()) {
            return lic;
        }
        return null;
    }

    private LicenseImpl(Map<String, String> props) {
        if (props != null) {
            this.putAll(props);
        }
    }

    public boolean isValid() {
        String downloadid = this.getDownloadId();
        return downloadid != null && Checker.check((String)downloadid.trim());
    }

    @Override
    public String getDownloadId() {
        return (String)this.get("license.downloadID");
    }

    @Override
    public String getCustomerName() {
        return (String)this.get("license.customer.name");
    }

    @Override
    public String getProductName() {
        return (String)this.get("license.product.name");
    }

    @Override
    public String getProductVersion() {
        return (String)this.get("license.product.version");
    }
}