Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.6.0)
E15995-05


oracle.wcps.property
Class DateTime

java.lang.Object
  extended by oracle.wcps.property.DateTime

All Implemented Interfaces:
java.io.Serializable, PropertyValue

public class DateTime
extends java.lang.Object
implements PropertyValue, java.io.Serializable

Encapsulates a datetime. The datetime is stored as a timestamp and may be persisted as a timestamp.

See Also:
Serialized Form

Field Summary
static java.lang.String DATETIME_FORMAT
           

 

Constructor Summary
DateTime()
           
DateTime(java.util.Calendar cal)
          Creates this by converting the given cal calendar value into timestamp.
DateTime(java.util.Date utilDate)
          Creates this by converting the given utilDate into a timestamp value.
DateTime(long timeInMillis)
          Create this by converting the given timeInMillis value into a timestamp value.
DateTime(java.lang.String value)
          Creates this by parsing the given value into a Timestamp value.
DateTime(java.sql.Timestamp value)
          Creates this with the given timestamp value.

 

Method Summary
 java.util.List<PropertyValue> asList(DateTime[] ts)
          Converts the given array to list of this.
 boolean equals(java.lang.Object o)
           
 java.util.Date getDate()
          Converts this into a Date.
 java.sql.Timestamp getValue()
          Returns a raw property value.
 int hashCode()
           
 void setValue(java.sql.Timestamp value)
          Sets the given timestamp value as the value for this.
 java.lang.String toString()
           
 java.io.Serializable unwrap()
          Unwraps this into correct type value.
 java.io.Serializable unwrap(java.util.List<? extends PropertyValue> values, boolean isMultiValue)
          Unwraps this into correct type values.

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

 

Field Detail

DATETIME_FORMAT

public static java.lang.String DATETIME_FORMAT

Constructor Detail

DateTime

public DateTime()

DateTime

public DateTime(java.lang.String value)
         throws java.text.ParseException
Creates this by parsing the given value into a Timestamp value. The datetime format used for parsing is
  yyyy-MM-dd'T'HH:mm:ss.SSSZZ
 
Parameters:
value - the string representation of a datetime in the above format.
Throws:
ParseException - if unable to parse the given string.
java.text.ParseException

DateTime

public DateTime(java.sql.Timestamp value)
Creates this with the given timestamp value.
Parameters:
value - value to be stored.

DateTime

public DateTime(java.util.Date utilDate)
Creates this by converting the given utilDate into a timestamp value.
Parameters:
utilDate - date value.

DateTime

public DateTime(long timeInMillis)
Create this by converting the given timeInMillis value into a timestamp value.
Parameters:
timeInMillis - value representing time in milliseconds.

DateTime

public DateTime(java.util.Calendar cal)
Creates this by converting the given cal calendar value into timestamp.
Parameters:
cal - a calendar instance.

Method Detail

getValue

public java.sql.Timestamp getValue()
Description copied from interface: PropertyValue
Returns a raw property value.
Specified by:
getValue in interface PropertyValue
Returns:
a property value.

setValue

public void setValue(java.sql.Timestamp value)
Sets the given timestamp value as the value for this.
Parameters:
value - a timestamp value.

asList

public java.util.List<PropertyValue> asList(DateTime[] ts)
Converts the given array to list of this.
Parameters:
ts - an array of this.
Returns:
list of element of ts.

unwrap

public java.io.Serializable unwrap(java.util.List<? extends PropertyValue> values,
                                   boolean isMultiValue)
Description copied from interface: PropertyValue
Unwraps this into correct type values. If isMultiValue is true it will convert values into an array of values.
Specified by:
unwrap in interface PropertyValue
Parameters:
values - a list of property values.
isMultiValue - if this is an array or not.
Returns:
unwrapped values.

getDate

public java.util.Date getDate()
Converts this into a Date.
Returns:
a date value.

unwrap

public java.io.Serializable unwrap()
Description copied from interface: PropertyValue
Unwraps this into correct type value.
Specified by:
unwrap in interface PropertyValue
Returns:
a raw property value whose type is one of the Type enum values.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.6.0)
E15995-05


Copyright © 2009, 2012, Oracle and/or its affiliates. All rights reserved.