Package com.iizix.device
Class DeviceParameter
java.lang.Object
com.iizix.device.DeviceParameter
- Direct Known Subclasses:
- DeviceAutoSignIn
Class used to send parameters between the server and the client. Support for sensitive information by means of encryption is supported. Parameters that are sensitive are stored in a secure space on the client side.
This class is not thread safe and gets the value and state updated in calls to the method to set to retrieve parameters.
Valid parameter name
The valid name of a device parameter are the characters A-Z, a-z, 0-9 and any of the following characters !#$%&*+-^_`|~. Please note that the single or double-quotes are not allowed. The name must start with a character A-Z, a-z or 0-9. The name must also have a length of 1 to 64 characters.
- Author:
- Christopher Mindus
- Nested Class SummaryNested ClassesModifier and TypeClassDescription- static enumThe states for this DeviceParameter instance.
- Constructor SummaryConstructorsConstructorDescription- DeviceParameter- (String name) Constructs a normal (unsecured) parameter to retrieve, set or remove from the client depending on if the- getValue()is- null.- DeviceParameter- (String name, boolean isSensitive) Constructs a secured (or sensitive) parameter to retrieve, set or remove from the client depending on if the- getValue()is- null.- DeviceParameter- (String name, String value) Constructs a normal (unsecured) parameter to retrieve, set or remove from the client depending on if the- valueis- null.- DeviceParameter- (String name, String value, boolean isSensitive) Constructs a secured (or sensitive) parameter to retrieve, set or remove from the client depending on if the- valueis- null.- DeviceParameter- (String name, String value, boolean isSensitive, DeviceParameter.State state) Constructs a secured (or sensitive) parameter to retrieve, set or remove from the client depending on if the- valueis- null.
- Method SummaryModifier and TypeMethodDescription- final booleanChecks if two parameters are equal.- getName()Gets the name of the device parameter.- final DeviceParameter.State- getState()Gets the state of the device parameter.- final String- getValue()Gets the value.- final int- hashCode()Hash code.- final booleanFlag for sensitive value, i.e.- final void- setState- (DeviceParameter.State state) Assigns the state.- final void- setValue- (String value, DeviceParameter.State state) Assigns the value and the state.- final String- toString()Outputs a debug string.
- Constructor Details- DeviceParameterConstructs a normal (unsecured) parameter to retrieve, set or remove from the client depending on if the- getValue()is- null. Default value is- nulland is generally used when retrieving the parameter.- Parameters:
- name- The parameter name, see Valid parameter name.
- Throws:
- NullPointerException- If the name is null.
- IllegalArgumentException- If the name is not valid.
 
- DeviceParameterConstructs a secured (or sensitive) parameter to retrieve, set or remove from the client depending on if the- getValue()is- null. Default value is- nulland is generally used when retrieving the parameter.- Parameters:
- name- The parameter name, see Valid parameter name.
- isSensitive- Flag indicating the value is a sensitive value, i.e. it must be encrypted and saved securely.
- Throws:
- NullPointerException- If the name is null.
- IllegalArgumentException- If the name is not valid.
 
- DeviceParameterConstructs a normal (unsecured) parameter to retrieve, set or remove from the client depending on if the- valueis- null.- Parameters:
- name- The parameter name, see Valid parameter name.
- value- The value,- nullif it the device parameter should be removed.
- Throws:
- NullPointerException- If the name is null.
- IllegalArgumentException- If the name is not valid.
 
- DeviceParameterConstructs a secured (or sensitive) parameter to retrieve, set or remove from the client depending on if the- valueis- null.- Parameters:
- name- The parameter name, see Valid parameter name.
- value- The value,- nullif it the device parameter should be removed.
- isSensitive- Flag indicating the value is a sensitive value, i.e. it must be encrypted and saved securely.
- Throws:
- NullPointerException- If the name is null.
- IllegalArgumentException- If the name is not valid.
 
- DeviceParameterConstructs a secured (or sensitive) parameter to retrieve, set or remove from the client depending on if the- valueis- null.- Parameters:
- name- The parameter name must be a valid Atom name without leading '$' or '-'.
- value- The value, null to remove it.
- isSensitive- Flag indicating the value is a sensitive value, i.e. it must be encrypted and saved securely.
- Throws:
- IllegalArgumentException- If the name is not valid.
 
 
- Method Details- getNameGets the name of the device parameter.- Returns:
- The name.
 
- isSensitivepublic final boolean isSensitive()Flag for sensitive value, i.e. it must be encrypted and saved securely.- Returns:
- trueif the value is encrypted with device exchanges,- falseotherwise.
 
- setValueAssigns the value and the state.- Parameters:
- value- The value,- nullif it the device parameter should be removed.
- state- The new state.
 
- setStateAssigns the state.- Parameters:
- state- The new state.
 
- getValueGets the value.- Returns:
- The value, null if removed.
 
- getStateGets the state of the device parameter.- Returns:
- The state.
 
- equalsChecks if two parameters are equal. The- stateis not used in the comparison.
- hashCodepublic final int hashCode()Hash code.
- toStringOutputs a debug string.