com.smardec.license4j
Class License
java.lang.Object
|
+--com.smardec.license4j.License
- All Implemented Interfaces:
- java.io.Serializable
- public final class License
- extends java.lang.Object
- implements java.io.Serializable
Class for storing license data. It can store any number of features and their
values like Hashtable . You can store any Serializable
object as feature's value. Also you can have unsigned features - features that
are not used in the signature generation/verification and therefore can change
their values leaving the license valid.
Constructor Summary |
License()
Creates License object with no features. |
Method Summary |
void |
addFeature(java.lang.String name,
java.lang.Object value)
Adds feature to the license. |
void |
addUnsignedFeature(java.lang.String name,
java.lang.Object value)
Adds unsigned feature to the license. |
java.lang.Object |
getFeature(java.lang.String name)
Returns value of the feature with the specified feature's name. |
java.lang.String |
getFeatureAsString(java.lang.String name)
Returns String value of the feature with the specified feature's name. |
java.util.List |
getFeatureList()
Returns list of all feature names. |
java.lang.Object |
removeFeature(java.lang.String name)
Removes feature with the specified name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
License
public License()
- Creates
License object with no features.
getFeature
public java.lang.Object getFeature(java.lang.String name)
- Returns value of the feature with the specified feature's name.
- Parameters:
- name - name of the feature
- Returns:
- value of the feature or
null if there is no feature with specified name.
getFeatureAsString
public java.lang.String getFeatureAsString(java.lang.String name)
- Returns
String value of the feature with the specified feature's name.
- Parameters:
- name - name of the feature
- Returns:
- value of the feature or
null if there is no feature with specified name.
addFeature
public void addFeature(java.lang.String name,
java.lang.Object value)
- Adds feature to the license.
- Parameters:
- name - name of the feature
- value - value of the feature
addUnsignedFeature
public void addUnsignedFeature(java.lang.String name,
java.lang.Object value)
- Adds unsigned feature to the license.
Unsigned features are not used in the signature generation
and can change their values in the license file leaving the license valid.
- Parameters:
- name - name of the feature
- value - value of the feature
removeFeature
public java.lang.Object removeFeature(java.lang.String name)
- Removes feature with the specified name.
- Parameters:
- name - name of the feature
- Returns:
- value of the removed feature.
getFeatureList
public java.util.List getFeatureList()
- Returns list of all feature names.
- Returns:
- list of feature names.
|