EdmDateTime.getInstance().valueToString(milliSeconds, EdmLiteralKind.DEFAULT, facets); final int offsetHours = offsetInMinutes / 60; final int offsetMinutes = Math.abs(offsetInMinutes % 60);
appendTwoDigits(result, year / 100); appendTwoDigits(result, year % 100); result.append('-'); appendTwoDigits(result, dateTimeValue.get(Calendar.MONTH) + 1); // month is zero-based result.append('-'); appendTwoDigits(result, dateTimeValue.get(Calendar.DAY_OF_MONTH)); result.append('T'); appendTwoDigits(result, dateTimeValue.get(Calendar.HOUR_OF_DAY)); result.append(':'); appendTwoDigits(result, dateTimeValue.get(Calendar.MINUTE)); result.append(':'); appendTwoDigits(result, dateTimeValue.get(Calendar.SECOND)); dateTimeValue.get(Calendar.MILLISECOND); try { appendFractionalSeconds(result, fractionalSecs, value instanceof Timestamp, facets); } catch (final IllegalArgumentException e) { throw new EdmSimpleTypeException(EdmSimpleTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e);
appendTwoDigits(result, year / 100); appendTwoDigits(result, year % 100); result.append('-'); appendTwoDigits(result, dateTimeValue.get(Calendar.MONTH) + 1); // month is zero-based result.append('-'); appendTwoDigits(result, dateTimeValue.get(Calendar.DAY_OF_MONTH)); result.append('T'); appendTwoDigits(result, dateTimeValue.get(Calendar.HOUR_OF_DAY)); result.append(':'); appendTwoDigits(result, dateTimeValue.get(Calendar.MINUTE)); result.append(':'); appendTwoDigits(result, dateTimeValue.get(Calendar.SECOND)); appendMilliseconds(result, dateTimeValue.get(Calendar.MILLISECOND), facets); } catch (final IllegalArgumentException e) { throw new EdmSimpleTypeException(EdmSimpleTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e);
if(EdmDateTime.getInstance().validate(jsonDateValue, EdmLiteralKind.JSON,null)) return EdmDateTime.getInstance().valueOfString(jsonDateValue, EdmLiteralKind.JSON, null, Calendar.class);
@Override protected AbstractSimpleType getSimpleTypeInstance() { return EdmDateTime.getInstance(); } }
final Timestamp timestamp = EdmDateTime.getInstance().internalValueOfString( value.substring(0, matcher.group(1) == null ? value.length() : matcher.start(1)), EdmLiteralKind.DEFAULT, facets, Timestamp.class);
try { return EdmDateTime .getInstance() .valueOfString(value, EdmLiteralKind.JSON, null, Calendar.class);
dateTimeValue.get(Calendar.MILLISECOND); try { EdmDateTime.appendFractionalSeconds(result, fractionalSecs, value instanceof Timestamp, facets); } catch (final IllegalArgumentException e) { throw new EdmSimpleTypeException(EdmSimpleTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e);
try { if(EdmDateTime.getInstance().validate(jsonDateValue, EdmLiteralKind.JSON,null)) return EdmDateTime.getInstance().valueOfString(jsonDateValue, EdmLiteralKind.JSON, null, Date.class);
@Override @Nonnull protected AbstractSimpleType getODataTypeInstance() { return EdmDateTime.getInstance(); } }
final Timestamp timestamp = EdmDateTime.getInstance().internalValueOfString( value.substring(0, matcher.group(1) == null ? value.length() : matcher.start(1)), EdmLiteralKind.DEFAULT, facets, Timestamp.class);
dateTimeValue.get(Calendar.MILLISECOND); try { EdmDateTime.appendFractionalSeconds(result, fractionalSecs, value instanceof Timestamp, facets); } catch (final IllegalArgumentException e) { throw new EdmSimpleTypeException(EdmSimpleTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e);
EdmDateTime.getInstance().valueToString( value instanceof Timestamp ? value : milliSeconds, EdmLiteralKind.DEFAULT, facets); final int offsetHours = offsetInMinutes / 60;
try { if(EdmDateTime.getInstance().validate(jsonDateValue, EdmLiteralKind.JSON,null)) return EdmDateTime.getInstance().valueOfString(jsonDateValue, EdmLiteralKind.JSON, null, Long.class);
return EdmByte.getInstance(); case DateTime: return EdmDateTime.getInstance(); case DateTimeOffset: return EdmDateTimeOffset.getInstance();
appendTwoDigits(result, year / 100); appendTwoDigits(result, year % 100); result.append('-'); appendTwoDigits(result, dateTimeValue.get(Calendar.MONTH) + 1); // month is zero-based result.append('-'); appendTwoDigits(result, dateTimeValue.get(Calendar.DAY_OF_MONTH)); result.append('T'); appendTwoDigits(result, dateTimeValue.get(Calendar.HOUR_OF_DAY)); result.append(':'); appendTwoDigits(result, dateTimeValue.get(Calendar.MINUTE)); result.append(':'); appendTwoDigits(result, dateTimeValue.get(Calendar.SECOND)); dateTimeValue.get(Calendar.MILLISECOND); try { appendFractionalSeconds(result, fractionalSecs, value instanceof Timestamp, facets); } catch (final IllegalArgumentException e) { throw new EdmSimpleTypeException(EdmSimpleTypeException.VALUE_FACETS_NOT_MATCHED.addContent(value, facets), e);
EdmDateTime.getInstance().valueToString( value instanceof Timestamp ? value : milliSeconds, EdmLiteralKind.DEFAULT, facets); final int offsetHours = offsetInMinutes / 60;
return EdmByte.getInstance(); case DateTime: return EdmDateTime.getInstance(); case DateTimeOffset: return EdmDateTimeOffset.getInstance();
return EdmByte.getInstance(); case DateTime: return EdmDateTime.getInstance(); case DateTimeOffset: return EdmDateTimeOffset.getInstance();