Package org.openjdk.jmc.common.unit
Class QuantityConversionException.Quantity
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- org.openjdk.jmc.common.unit.QuantityConversionException
-
- org.openjdk.jmc.common.unit.QuantityConversionException.Quantity
-
- All Implemented Interfaces:
java.io.Serializable
- Enclosing class:
- QuantityConversionException
public static class QuantityConversionException.Quantity extends QuantityConversionException
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openjdk.jmc.common.unit.QuantityConversionException
QuantityConversionException.Persisted, QuantityConversionException.Problem, QuantityConversionException.Quantity
-
-
Field Summary
Fields Modifier and Type Field Description protected IQuantity
badQuantity
protected IQuantity
prototype
private static long
serialVersionUID
-
Fields inherited from class org.openjdk.jmc.common.unit.QuantityConversionException
badString, problem
-
-
Constructor Summary
Constructors Constructor Description Quantity(QuantityConversionException.Problem problem, java.lang.String badString, IQuantity prototype)
Quantity(QuantityConversionException.Problem problem, IQuantity badQuantity, IQuantity prototype)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getInteractivePrototype()
Prototype value suitable to be presented to a human.java.lang.String
getLocalizedMessage()
java.lang.String
getMessage()
java.lang.String
getPersistablePrototype()
Prototype value suitable to be persisted or logged.private static java.lang.String
readableProto(ITypedQuantity<LinearUnit> prototype, LinearUnit userUnit)
Produce a string that presents a prototype value.-
Methods inherited from class org.openjdk.jmc.common.unit.QuantityConversionException
belowPrecision, belowPrecision, conflictingConstraints, getBadString, getProblem, noUnit, noUnit, tooHigh, tooHigh, tooLow, tooLow, toString, unknownUnit, unknownUnit, unparsable, unparsable
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
badQuantity
protected final IQuantity badQuantity
-
prototype
protected final IQuantity prototype
-
-
Constructor Detail
-
Quantity
public Quantity(QuantityConversionException.Problem problem, java.lang.String badString, IQuantity prototype)
-
Quantity
public Quantity(QuantityConversionException.Problem problem, IQuantity badQuantity, IQuantity prototype)
-
-
Method Detail
-
getMessage
public java.lang.String getMessage()
- Overrides:
getMessage
in classQuantityConversionException
-
getLocalizedMessage
public java.lang.String getLocalizedMessage()
- Overrides:
getLocalizedMessage
in classQuantityConversionException
-
readableProto
private static java.lang.String readableProto(ITypedQuantity<LinearUnit> prototype, LinearUnit userUnit)
Produce a string that presents a prototype value. "Exact value ~= value in user unit ~= value in auto unit".- Parameters:
prototype
- prototype value to presentuserUnit
- alternative unit to present the prototype value in- Returns:
- a readable string containing the value
-
getPersistablePrototype
public java.lang.String getPersistablePrototype()
Description copied from class:QuantityConversionException
Prototype value suitable to be persisted or logged.- Specified by:
getPersistablePrototype
in classQuantityConversionException
- Returns:
- a non-localized (English) value that will prevent this particular problem when parsed.
-
getInteractivePrototype
public java.lang.String getInteractivePrototype()
Description copied from class:QuantityConversionException
Prototype value suitable to be presented to a human. Must not be persisted or logged.- Specified by:
getInteractivePrototype
in classQuantityConversionException
- Returns:
- a localized value that will prevent this particular problem when parsed using interactive parsing.
-
-