public final class Utils extends Object
Date/Calendar
conversionsModifier and Type | Method and Description |
---|---|
static Calendar |
blastTime(Calendar cal)
Removes set's all "time" fields to zero, leaving only the date portion of
the Calendar.
|
static Calendar |
createCalendar(String dateStr)
get a new Calendar based on the string date.
|
static Date |
createDate(String dateStr)
Creates a Date object given a string representation of it
|
static Calendar |
getCal(Date date)
Get a Calendar object for a given Date representation.
|
static Calendar |
getCal(String dateStr) |
static Set<Calendar> |
toCalendarSet(Set<Date> dates)
Converts a Set of Date objects to a Set of Calendar objects.
|
static List<Date> |
toDateList(List<Calendar> dates)
Converts a
List of Calendar objects to a List
of dates |
static Set<Date> |
toDateSet(Set<Calendar> calendars)
Converts a Set of Calendar objects to a Set of Date objects
|
static HolidayCalendar<Calendar> |
toHolidayCalendarSet(HolidayCalendar<Date> dates)
Converts a Set of Date objects to a Set of Calendar objects.
|
public static Calendar blastTime(Calendar cal)
cal
- to Calendar object to blast, note, it will be modifiedpublic static Date createDate(String dateStr)
dateStr
- string (return today if string is null)IllegalArgumentException
- if the string cannot be parsed.public static Calendar createCalendar(String dateStr)
dateStr
- the date stringIllegalArgumentException
- if the string cannot be parsed.public static Calendar getCal(Date date)
date
- public static Set<Calendar> toCalendarSet(Set<Date> dates)
dates
- public static HolidayCalendar<Calendar> toHolidayCalendarSet(HolidayCalendar<Date> dates)
dates
- public static Set<Date> toDateSet(Set<Calendar> calendars)
calendars
- Copyright © 2006–2022 Appendium - Portfolio Financing Platform. All rights reserved.