@Immutable public final class FloatData extends NumberData
Important: This class may only be used in implementing plugins (e.g. functions, directives).
| Constructor and Description |
|---|
FloatData(double value)
Deprecated.
Use
forValue(double). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
coerceToBoolean()
Coerces this value into a boolean.
|
String |
coerceToString()
Coerces this value into a string.
|
double |
floatValue()
Precondition: Only call this method if you know that this SoyValue object is a float.
|
static FloatData |
forValue(double value)
Gets a FloatData instance for the given value.
|
double |
getValue()
Returns the float value.
|
double |
toFloat()
Gets the float value of this number data object.
|
String |
toString() |
static String |
toString(double value)
Returns Soy's idea of a double as a string.
|
equals, hashCode, numberValuerendercreateFromExistingDatabooleanValue, integerValue, longValue, render, renderAndResolve, resolve, status, stringValue@Deprecated public FloatData(double value)
forValue(double).value - The float value.public static FloatData forValue(double value)
value - The desired value.public double getValue()
public double floatValue()
SoyValuefloatValue in interface SoyValuefloatValue in class SoyAbstractValuepublic static String toString(double value)
public boolean coerceToBoolean()
0.0 is falsy as is NaN.
public String coerceToString()
SoyValuepublic double toFloat()
NumberDatatoFloat in class NumberData