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

com.greenpepper.server.license.LicenseBean Maven / Gradle / Ivy

There is a newer version: 4.2.4
Show newest version
package com.greenpepper.server.license;

import java.util.Vector;

import com.greenpepper.repository.Marshalizable;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_TYPE_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_EXPIRY_DATE_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_SUPPORT_EXPIRY_DATE_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_MAX_USERS_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_EXTRA_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_INFO_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_VERSION_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_HOLDER_NAME_IDX;
import static com.greenpepper.server.rpc.xmlrpc.XmlRpcDataMarshaller.LICENSE_EFFECTIVE_DATE_IDX;
import com.greenpepper.util.StringUtil;

/**
 * 

LicenseBean class.

* * @author oaouattara * @version $Id: $Id */ public class LicenseBean implements Marshalizable { private String licenseType; private String notBefore; private String noSupportAfter; private String notAfter; private String version; private int maxUsers; private String holderName; private String info; /** *

Getter for the field licenseType.

* * @return a {@link java.lang.String} object. */ public String getLicenseType() { return licenseType; } /** *

Setter for the field licenseType.

* * @param licenseType a {@link java.lang.String} object. */ public void setLicenseType(String licenseType) { this.licenseType = licenseType; } /** *

hasMaxUsers.

* * @return a boolean. */ public boolean hasMaxUsers() { return maxUsers > 0; } /** *

Getter for the field maxUsers.

* * @return a int. */ public int getMaxUsers() { return maxUsers; } /** *

Setter for the field maxUsers.

* * @param maxUsers a int. */ public void setMaxUsers(int maxUsers) { this.maxUsers = maxUsers; } /** *

Getter for the field notBefore.

* * @return a {@link java.lang.String} object. */ public String getNotBefore() { return notBefore; } /** *

Setter for the field notBefore.

* * @param notBefore a {@link java.lang.String} object. */ public void setNotBefore(String notBefore) { this.notBefore = notBefore; } /** *

Getter for the field notAfter.

* * @return a {@link java.lang.String} object. */ public String getNotAfter() { return notAfter; } /** *

Setter for the field notAfter.

* * @param notAfter a {@link java.lang.String} object. */ public void setNotAfter(String notAfter) { this.notAfter = notAfter; } /** *

Getter for the field noSupportAfter.

* * @return a {@link java.lang.String} object. */ public String getNoSupportAfter() { return noSupportAfter; } /** *

Getter for the field info.

* * @return a {@link java.lang.String} object. */ public String getInfo() { return info; } /** *

Setter for the field info.

* * @param info a {@link java.lang.String} object. */ public void setInfo(String info) { this.info = info; } /** *

Setter for the field noSupportAfter.

* * @param noSupportAfter a {@link java.lang.String} object. */ public void setNoSupportAfter(String noSupportAfter) { this.noSupportAfter = noSupportAfter; } /** *

hasLicenseType.

* * @return a boolean. */ public boolean hasLicenseType() { return !StringUtil.isEmpty(licenseType); } /** *

hasNotAfter.

* * @return a boolean. */ public boolean hasNotAfter() { return !StringUtil.isEmpty(notAfter); } /** *

hasNoSupportAfter.

* * @return a boolean. */ public boolean hasNoSupportAfter() { return !StringUtil.isEmpty(noSupportAfter); } /** *

hasNotBefore.

* * @return a boolean. */ public boolean hasNotBefore() { return !StringUtil.isEmpty(notBefore); } /** *

Getter for the field version.

* * @return a {@link java.lang.String} object. */ public String getVersion() { return version; } /** *

Setter for the field version.

* * @param version a {@link java.lang.String} object. */ public void setVersion(String version) { this.version = version; } /** *

hasHolderName.

* * @return a boolean. */ public boolean hasHolderName() { return !StringUtil.isEmpty(holderName); } /** *

Getter for the field holderName.

* * @return a {@link java.lang.String} object. */ public String getHolderName() { return holderName; } /** *

Setter for the field holderName.

* * @param holderName a {@link java.lang.String} object. */ public void setHolderName(String holderName) { this.holderName = holderName; } /** *

marshallize.

* * @return a {@link java.util.Vector} object. */ public Vector marshallize() { Vector parameters = new Vector(); parameters.add(LICENSE_TYPE_IDX, licenseType); parameters.add(LICENSE_EXPIRY_DATE_IDX, notAfter); parameters.add(LICENSE_SUPPORT_EXPIRY_DATE_IDX, noSupportAfter); parameters.add(LICENSE_MAX_USERS_IDX, maxUsers); parameters.add(LICENSE_INFO_IDX, info); parameters.add(LICENSE_VERSION_IDX, version); parameters.add(LICENSE_EXTRA_IDX, 0); parameters.add(LICENSE_HOLDER_NAME_IDX, holderName); parameters.add(LICENSE_EFFECTIVE_DATE_IDX, notBefore); return parameters; } }