Class DateTimeValue
- java.lang.Object
-
- org.ow2.authzforce.core.pdp.api.value.SimpleValue<V>
-
- org.ow2.authzforce.core.pdp.api.value.StringParseableValue<XMLGregorianCalendar>
-
- org.ow2.authzforce.core.pdp.api.value.BaseTimeValue<DateTimeValue>
-
- org.ow2.authzforce.core.pdp.api.value.DateTimeValue
-
- All Implemented Interfaces:
Comparable<DateTimeValue>
,AttributeValue
,PrimitiveValue
,Value
public final class DateTimeValue extends BaseTimeValue<DateTimeValue>
Representation of a xs:dateTime value. This class supports parsing xs:dateTime values. All objects of this class are immutable and thread-safe.- Version:
- $Id: $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
StringParseableValue.Factory<AV extends AttributeValue>
-
Nested classes/interfaces inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
SimpleValue.BaseFactory<AV extends AttributeValue>
-
-
Field Summary
-
Fields inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
value
-
-
Constructor Summary
Constructors Constructor Description DateTimeValue(String dateTime)
Creates a newDateTimeAttributeValue
from a string representation of date/timeDateTimeValue(GregorianCalendar dateTime)
Creates a newDateTimeAttributeValue
that represents the supplied dateDateTimeValue(XMLGregorianCalendar dateTime)
Creates a newDateTimeAttributeValue
that represents the supplied date
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DateTimeValue
add(DurationValue<?> durationVal)
Add duration to this timeDateTimeValue
subtract(DurationValue<?> durationVal)
Subtract duration to this time-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.BaseTimeValue
compareTo, printXML
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.StringParseableValue
getXmlAttributes
-
Methods inherited from class org.ow2.authzforce.core.pdp.api.value.SimpleValue
equals, getContent, getUnderlyingValue, hashCode, toString
-
-
-
-
Constructor Detail
-
DateTimeValue
public DateTimeValue(String dateTime) throws IllegalArgumentException
Creates a newDateTimeAttributeValue
from a string representation of date/time- Parameters:
dateTime
- string representation of date/time- Throws:
IllegalArgumentException
- ifdateTime
is not a valid string representation for this value datatype
-
DateTimeValue
public DateTimeValue(XMLGregorianCalendar dateTime) throws IllegalArgumentException
Creates a newDateTimeAttributeValue
that represents the supplied date- Parameters:
dateTime
- aXMLGregorianCalendar
object representing the specified date and time- Throws:
IllegalArgumentException
- ifdateTime
does not correspond to a valid xs:dateTime
-
DateTimeValue
public DateTimeValue(GregorianCalendar dateTime)
Creates a newDateTimeAttributeValue
that represents the supplied date- Parameters:
dateTime
- aGregorianCalendar
object representing the specified date and time- Throws:
IllegalArgumentException
- ifdateTime
does not correspond to a valid xs:dateTime
-
-
Method Detail
-
add
public DateTimeValue add(DurationValue<?> durationVal)
Add duration to this time- Specified by:
add
in classBaseTimeValue<DateTimeValue>
- Parameters:
durationVal
- duration value- Returns:
- this + durationVal
-
subtract
public DateTimeValue subtract(DurationValue<?> durationVal)
Subtract duration to this time- Specified by:
subtract
in classBaseTimeValue<DateTimeValue>
- Parameters:
durationVal
- duration value- Returns:
- this - durationVal
-
-