freemarker.template

## Class SimpleDate

- java.lang.Object
- - freemarker.template.SimpleDate

All Implemented Interfaces:
  TemplateDateModel, TemplateModel

    public class SimpleDate
    extends Object
    implements TemplateDateModel

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

This class is thread-safe.

### Field Summary

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

`DATE, DATETIME, TIME, TYPE_NAMES, UNKNOWN`

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

`NOTHING`

### Constructor Summary

Constructors
Constructor and Description
`SimpleDate(Date date)` Creates a new date model wrapping the specified date object and having DATE type.
`SimpleDate(Date date, int type)` Creates a new date model wrapping the specified date object and having the specified type.
`SimpleDate(Time time)` Creates a new date model wrapping the specified time object and having TIME type.
`SimpleDate(Timestamp datetime)` Creates a new date model wrapping the specified time object and having DATETIME type.

### Method Summary

All Methods Instance Methods Concrete Methods
`Date` `getAsDate()` Returns the date value.
`int` `getDateType()` Returns the type of the date.
`String` `toString()`

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

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

### Constructor Detail

#### SimpleDate

    public SimpleDate(Date date)

Creates a new date model wrapping the specified date object and having DATE type.

#### SimpleDate

    public SimpleDate(Time time)

Creates a new date model wrapping the specified time object and having TIME type.

#### SimpleDate

    public SimpleDate(Timestamp datetime)

Creates a new date model wrapping the specified time object and having DATETIME type.

#### SimpleDate

    public SimpleDate(Date date,
                      int type)

Creates a new date model wrapping the specified date object and having the specified type.

### Method Detail

#### getAsDate

    public Date getAsDate()

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

Specified by:
  `getAsDate` in interface `TemplateDateModel`

#### getDateType

    public int getDateType()

Description copied from interface: `TemplateDateModel`
Returns the type of the date. It can be any of `TemplateDateModel.TIME`, `TemplateDateModel.DATE`, or `TemplateDateModel.DATETIME`.

Specified by:
  `getDateType` in interface `TemplateDateModel`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`