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

com.alachisoft.ncache.licensing.config.LicenseInfo Maven / Gradle / Ivy

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.alachisoft.ncache.licensing.config;

import com.alachisoft.ncache.ncactivate.utils.RegKeys;

public class LicenseInfo {
    private String privateLicenseKey,
            privateAuthCode,
            privateExtCode,
            privateDeactivateKey,
            privateDeactCode;

    public String getValue(RegKeys key){
        switch (key){
            case AuthCode:
                return getAuthCode();
            case ExtCode:
                return getExtCode();
            case DeactCode:
                return getDeactCode();
            case DeactivateKey:
                return getDeactivateKey();
            default:
                return null;
        }
    }

    public final String getLicenseKey() {
        return privateLicenseKey;
    }

    public final void setLicenseKey(String value) {
        privateLicenseKey = value;
    }

    public final String getAuthCode() {
        return privateAuthCode;
    }

    public final void setAuthCode(String value) {
        privateAuthCode = value;
    }

    public final String getDeactivateKey() {
        return privateDeactivateKey;
    }

    public final void setDeactivationKey(String value) {
        privateDeactivateKey = value;
    }

    public final String getDeactCode() {
        return privateDeactCode;
    }

    public final void setDeactCode(String value) {
        privateDeactCode = value;
    }

    public final String getExtCode() {
        return privateExtCode;
    }

    public final void setExtCode(String value) {
        privateExtCode = value;
    }

    public LicenseInfo() {}

    protected LicenseInfo(Builder builder) {
        privateLicenseKey = builder.privateLicenseKey;
        privateAuthCode = builder.privateAuthCode;
        privateDeactCode = builder.privateDeactCode;
        privateExtCode = builder.privateExtCode;
        privateDeactivateKey = builder.privateDeactivateKey;
    }

    public static class Builder {
        private String privateLicenseKey,
                privateAuthCode,
                privateExtCode,
                privateDeactivateKey,
                privateDeactCode;

        public Builder setLicenseKey(String privateLicenseKey) {
            this.privateLicenseKey = privateLicenseKey;
            return this;
        }

        public Builder setAuthCode(String privateAuthCode) {
            this.privateAuthCode = privateAuthCode;
            return this;
        }

        public Builder setExtCode(String privateExtCode) {
            this.privateExtCode = privateExtCode;
            return this;
        }

        public Builder setDeactivateKey(String privateDeactivateKey) {
            this.privateDeactivateKey = privateDeactivateKey;
            return this;
        }

        public Builder setDeactCode(String privateDeactCode) {
            this.privateDeactCode = privateDeactCode;
            return this;
        }

        public LicenseInfo build() {
            return new LicenseInfo(this);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy