com.amazon.carbonado.adapter
Annotation Type DateTimeAdapter


@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
@AdapterDefinition(storageTypePreferences={long.class,java.lang.Long.class,java.lang.String.class})
public @interface DateTimeAdapter

Converts Joda-Time datetime objects to and from other forms. This adapter is applied automatically for all storable properties of type DateTime, DateMidnight, LocalDateTime, LocalDate and also Date. Explicit use allows a different time zone to be used, but this only works for Joda-Time objects.

Example:

 public interface UserInfo extends Storable {
     @DateTimeAdapter(timeZone="UTC")
     DateTime getModifyDateTime();
     void setModifyDateTime(DateTime dt);

     ...
 }
 

Author:
Brian S O'Neill, Justin Rudd
See Also:
AdapterDefinition

Optional Element Summary
 String timeZone
          Optionally specify a time zone to apply to new DateTimes, overriding the default time zone.
 

timeZone

public abstract String timeZone
Optionally specify a time zone to apply to new DateTimes, overriding the default time zone.

Default:
""


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.