T - Property type. Be sure the type is:
* One of default : Byte, Short, Int, Long, Float, Double, String, List, Map, Tuple, QiStruct.
* Or managed by a QiSerializer.public final class Property<T> extends Object
| Constructor and Description |
|---|
Property(Class<T> valueClass)
Create an empty property with a class and the default serializer.
|
Property(Class<T> valueClass,
QiSerializer serializer)
Create a property with a class and a serializer.
|
Property(Class<T> valueClass,
T value)
Create a property with a class and a value and the default serializer.
|
Property(Class<T> valueClass,
T value,
QiSerializer serializer)
Create a property with a class, a value and a serializer.
|
Property(T value)
Create a property with a value and the default serializer.
|
Property(T value,
QiSerializer serializer)
Create a property with a value and a serializer.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
finalize()
Called by JVM when object is garbage collected
|
QiSerializer |
getSerializer()
Current serializer.
|
Future<T> |
getValue()
Current property value.
|
Future<T> |
getValue(QiSerializer qiSerializer)
Current property value.
|
Future<Void> |
setValue(QiSerializer qiSerializer,
T value)
Change property value
|
Future<Void> |
setValue(T value)
Change property value
It will use the property serializer.
|
public Property(Class<T> valueClass, QiSerializer serializer)
valueClass - The property value class. Must not be null.serializer - Serializer to use for the conversion of the property value. Must not be null.public Property(Class<T> valueClass)
valueClass - The property value class.NullPointerException - if valueClass parameter is null.public Property(Class<T> valueClass, T value, QiSerializer serializer)
valueClass - The property value class. Must not be null.value - Value to initialize the property with. Must not be null, except for `Propertyserializer - Serializer to use for the conversion of the property value. Must not be null.a - customized NullPointerException if a parameter is null.public Property(T value, QiSerializer serializer)
value - Value to initialize the property with. Must not be null.serializer - Serializer to use for the conversion of the property value. Must not be null.a - customized NullPointerException if a parameter is null.public Property(T value)
value - Value to initialize the property with. Must not be nulla - customized NullPointerException if a parameter is null.public Property(Class<T> valueClass, T value)
valueClass - The property value class. Must not be null.value - Value to initialize the property with. Must not be null.a - customized NullPointerException if a parameter is null.public QiSerializer getSerializer()
public Future<T> getValue()
getValue(QiSerializer)public Future<T> getValue(QiSerializer qiSerializer)
qiSerializer - Serializer to use for deserialize the value. Must not be nullpublic Future<Void> setValue(T value)
setValue(QiSerializer, Object)value - New value. Warning may have strange result with nullpublic Future<Void> setValue(QiSerializer qiSerializer, T value)
qiSerializer - Serializer to use for serialize the value. Must not be nullvalue - New value. Must not be null, except for `PropertyCopyright © 2020. All rights reserved.