-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'v0.17.x_bugfix' into v0.17.x
- Loading branch information
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
...c/de/gebit/integrity/parameter/conversion/conversions/java/other/CalendarToTimestamp.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2013 Rene Schneider, GEBIT Solutions GmbH and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*******************************************************************************/ | ||
package de.gebit.integrity.parameter.conversion.conversions.java.other; | ||
|
||
import java.sql.Timestamp; | ||
import java.util.Calendar; | ||
|
||
import de.gebit.integrity.parameter.conversion.Conversion; | ||
import de.gebit.integrity.parameter.conversion.ConversionContext; | ||
import de.gebit.integrity.parameter.conversion.ConversionFailedException; | ||
|
||
/** | ||
* A default Integrity conversion. | ||
* | ||
* | ||
* @author Rene Schneider - initial API and implementation | ||
* | ||
*/ | ||
public class CalendarToTimestamp extends Conversion<Calendar, Timestamp> { | ||
|
||
@Override | ||
public Timestamp convert(Calendar aSource, Class<? extends Timestamp> aTargetType, | ||
ConversionContext aConversionContext) throws ConversionFailedException { | ||
return new Timestamp(aSource.getTimeInMillis()); | ||
} | ||
|
||
} |