org.hibernate.search.elasticsearch.util.impl

## Class ElasticsearchDateHelper

- java.lang.Object
- - org.hibernate.search.elasticsearch.util.impl.ElasticsearchDateHelper

-     public final class ElasticsearchDateHelper
      extends Object

  Various utilities to manipulate dates and comply with Elasticsearch date format.
  Author:
    Guillaume Smet

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `calendarToString(Calendar calendar)`
    `static String` | `dateToString(Date date)`
    `static Calendar` | `round(Calendar calendar, DateTools.Resolution resolution)` Limit a calendar resolution.
    `static Calendar` | `stringToCalendar(String value)`
    `static Date` | `stringToDate(String value)`

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

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

- - ### Method Detail

    - #### stringToDate

          public static Date stringToDate(String value)

    - #### dateToString

          public static String dateToString(Date date)

    - #### calendarToString

          public static String calendarToString(Calendar calendar)

    - #### stringToCalendar

          public static Calendar stringToCalendar(String value)

    - #### round

          public static Calendar round(Calendar calendar,
                                       DateTools.Resolution resolution)

      Limit a calendar resolution.
      Parameters:
        `calendar` - The calendar whose resolution is to be limited
        `resolution` - The desired resolution of the date to be returned
      Returns:
        the calendar with all values more precise than `resolution` set to 0 or 1
      See Also:
        `DateTools.round(Date, Resolution)`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved