freemarker.template

## Class SimpleNumber

- java.lang.Object
- - freemarker.template.SimpleNumber

All Implemented Interfaces:
  TemplateModel, TemplateNumberModel, Serializable

    public final class SimpleNumber
    extends Object
    implements TemplateNumberModel, Serializable

A simple implementation of the `TemplateNumberModel` interface. Note that this class is immutable.

This class is thread-safe.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from interface freemarker.template.TemplateModel

`NOTHING`

### Constructor Summary

Constructors
Constructor and Description
`SimpleNumber(byte val)`
`SimpleNumber(double val)`
`SimpleNumber(float val)`
`SimpleNumber(int val)`
`SimpleNumber(long val)`
`SimpleNumber(Number value)`
`SimpleNumber(short val)`

### Method Summary

All Methods Instance Methods Concrete Methods
`Number` `getAsNumber()` Returns the numeric value.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### SimpleNumber

    public SimpleNumber(Number value)

#### SimpleNumber

    public SimpleNumber(byte val)

#### SimpleNumber

    public SimpleNumber(short val)

#### SimpleNumber

    public SimpleNumber(int val)

#### SimpleNumber

    public SimpleNumber(long val)

#### SimpleNumber

    public SimpleNumber(float val)

#### SimpleNumber

    public SimpleNumber(double val)

### Method Detail

#### getAsNumber

    public Number getAsNumber()

Description copied from interface: `TemplateNumberModel`
Returns the numeric value. The return value must not be `null`.

Specified by:
  `getAsNumber` in interface `TemplateNumberModel`
Returns:
  the `Number` instance associated with this number model.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`