mirror of
https://github.com/danieldemus/openhab-core.git
synced 2025-01-11 05:41:52 +01:00
[core] Make logger in QuantityType transient (#1652)
This makes QuantityType serialisable Fixes #1651 Signed-off-by: Kai Kreuzer <kai@openhab.org>
This commit is contained in:
parent
5919f923d5
commit
fa18610d77
@ -55,7 +55,6 @@ import tec.uom.se.quantity.Quantities;
|
||||
// annotated.
|
||||
public class QuantityType<T extends Quantity<T>> extends Number
|
||||
implements PrimitiveType, State, Command, Comparable<QuantityType<T>> {
|
||||
private final Logger logger = LoggerFactory.getLogger(QuantityType.class);
|
||||
|
||||
private static final long serialVersionUID = 8828949721938234629L;
|
||||
private static final BigDecimal HUNDRED = BigDecimal.valueOf(100);
|
||||
@ -69,12 +68,14 @@ public class QuantityType<T extends Quantity<T>> extends Number
|
||||
// The later would be an exponent from the scalar value.
|
||||
private static final String UNIT_PATTERN = "(?<=\\d)\\s*(?=[a-zA-Z°µ%'](?![\\+\\-]?\\d))";
|
||||
|
||||
private final Quantity<T> quantity;
|
||||
|
||||
static {
|
||||
UnitInitializer.init();
|
||||
}
|
||||
|
||||
private transient final Logger logger = LoggerFactory.getLogger(QuantityType.class);
|
||||
|
||||
private final Quantity<T> quantity;
|
||||
|
||||
/**
|
||||
* Creates a dimensionless {@link QuantityType} with scalar 0 and unit {@link AbstractUnit#ONE}.
|
||||
* A default constructor is needed by {@link org.openhab.core.internal.items.ItemUpdater#receiveUpdate})
|
||||
|
Loading…
Reference in New Issue
Block a user