public class UnitValueContent extends DoubleContent
This content converter extends the DoubleContent
content converter
by specifying a multiplier whose value comes from the 'Multiplier' param.
This multiplier is used as a divisor during denormalization.
Proxied.Abstract
Modifier and Type | Field and Description |
---|---|
static String |
MULTIPLIER_PARAM
Conversion factor.
|
Constructor and Description |
---|
UnitValueContent() |
Modifier and Type | Method and Description |
---|---|
Double |
denormalize(NormalizedValue normalizedValue)
Denormalizes the value of a point value.
|
protected double |
getMultiplier()
Gets the multiplier.
|
Double |
normalize(PointValue pointValue)
Normalizes the value of a point value.
|
boolean |
setUp(Metadata metadata,
ProxyEntity proxyEntity)
Sets up the instance for action.
|
decode, getDouble
encode, getInstance, warnBadValue
getMetadata, getName, getParams, getProxyEntity, getThisLogger, tearDown
public static final String MULTIPLIER_PARAM
public Double denormalize(NormalizedValue normalizedValue)
Converts from an internal unit to an external unit.
denormalize
in interface Content
denormalize
in class DoubleContent
normalizedValue
- The point value associated with the value to be
denormalized.public Double normalize(PointValue pointValue)
Converts from an external unit to an internal unit.
normalize
in interface Content
normalize
in class DoubleContent
pointValue
- The point value associated with the value to be
normalized.public boolean setUp(Metadata metadata, ProxyEntity proxyEntity)
setUp
in interface Proxied
setUp
in class Proxied.Abstract
metadata
- The metadata available to the current process.proxyEntity
- The proxy entity refering to the proxied.@CheckReturnValue protected final double getMultiplier()
Copyright © 2003-2019 Serge Brisson. All Rights Reserved.