/** * Parses a formatted date into a Date object using the default HTTP format * (RFC 1123). * * @param date * The date to parse. * @return The parsed date. */ public static Date parse(String date) { return parse(date, FORMAT_RFC_1123); }
/** * Constructor. Pre-creates the minimum number of objects if needed using * the {@link #preCreate(int)} method. * * @param initialSize * The initial number of objects in the pool. */ public Pool(int initialSize) { this(); preCreate(initialSize); }
/** * Strips a delimiter character from both ends of the source string. * * @param source * The source string to strip. * @param delimiter * The character to remove. * @return The stripped string. */ public static String strip(String source, char delimiter) { return strip(source, delimiter, true, true); }
/** * @see com.vaadin.data.util.converter.Converter#convertToPresentation(java.lang.Object, java.lang.Class, java.util.Locale) */ public String convertToPresentation(String value, Class<? extends String> targetType, Locale locale) throws com.vaadin.data.util.converter.Converter.ConversionException { return StringUtils.nullToEmpty(value); }
/** * Sets the most recent moment when the entry was modified in a significant * way. * * @param updated * The most recent moment when the entry was modified in a * significant way. */ public void setUpdated(Date updated) { this.updated = DateUtils.unmodifiable(updated); }
/** * Constructor. * * @param webForm * The URL encoded Web form. * @throws IOException */ public Form(Representation webForm, boolean decode) { this(); FormUtils.parse(this, webForm, decode); }
/** * Converts the specified millisecond time value to an RFC 3339 date/time * string using the UTC (Z) time zone. * * @param time * the millisecond time value * @return an RFC 3339 date/time string (does not include milliseconds) */ public static String toString(long time) { return toString(time, UTC); }
/** * Pre-creates the initial objects using the {@link #createObject()} method * and check them in the pool using the {@link #checkin(Object)} method. * * @param initialSize * The initial number of objects. */ public void preCreate(int initialSize) { for (int i = 0; i < initialSize; i++) { checkin(createObject()); } }
/** * Returns the current date and time as an RFC 3339 date/time string using * the UTC (Z) time zone. * * @return an RFC 3339 date/time string (does not include milliseconds) */ public static String now() { return now(UTC); }
/** * Creates a new InternetDateFormat object from the specified millisecond * time value using the UTC (Z) time zone. * * @param time * the millisecond time value * @return the InternetDateFormat object */ public static InternetDateFormat valueOf(long time) { return new InternetDateFormat(time); }
/** * Returns an immutable version of a given date. * * @param date * The modifiable date. * @return An immutable version of a given date. */ public static Date unmodifiable(Date date) { return (date == null) ? null : new ImmutableDate(date); }
/** * Creates a resolver that is based on a given map. * * @param map * Map between names and values. * @return The map resolver. */ public static Resolver<?> createResolver(Map<String, ?> map) { return new MapResolver(map); }
/** * Creates a protected child context. This is especially useful for new * application attached to their parent component, to ensure their isolation * from the other applications. By default it creates a new context instance * with empty or null properties, except the client and server dispatchers * that are wrapped for isolation purpose. * * @return The child context. */ public Context createChildContext() { return new org.restlet.engine.util.ChildContext(this); }
/** * Sets the most recent moment when the entry was modified in a significant * way. * * @param updated * The most recent moment when the entry was modified in a * significant way. */ public void setUpdated(Date updated) { this.updated = DateUtils.unmodifiable(updated); }
/** * Converts this InternetDateFormat object to an RFC 3339 date/time string. * * @return an RFC 3339 date/time string (does not include milliseconds) */ public String toString() { return toString(cal); } }
/** * Sets the moment associated with an event early in the life cycle of the * entry. * * @param published * The moment associated with an event early in the life cycle of * the entry. */ public void setPublished(Date published) { this.published = DateUtils.unmodifiable(published); }
/** * Converts the specified Date object to an RFC 3339 date/time string using * the UTC (Z) time zone. * * @param date * the Date object * @return an RFC 3339 date/time string (does not include milliseconds) */ public static String toString(Date date) { return toString(date, UTC); }
/** * Sets the moment associated with an event early in the life cycle of the * entry. * * @param published * The moment associated with an event early in the life cycle of * the entry. */ public void setPublished(Date published) { this.published = DateUtils.unmodifiable(published); }
/** * Converts this InternetDateFormat object to an RFC 3339 date/time string. * * @return an RFC 3339 date/time string (does not include milliseconds) */ public String toString() { return toString(cal); } }
/** * Converts the specified Date object to an RFC 3339 date/time string using * the UTC (Z) time zone. * * @param date * the Date object * @return an RFC 3339 date/time string (does not include milliseconds) */ public static String toString(Date date) { return toString(date, UTC); }