Skip to content

Commit

Permalink
Merge branch 'v0.17.x_bugfix' into v0.17.x
Browse files Browse the repository at this point in the history
  • Loading branch information
S1artie committed Mar 23, 2018
2 parents b643388 + 7e85800 commit 68171b4
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
import de.gebit.integrity.parameter.conversion.conversions.java.other.CalendarToSQLDate;
import de.gebit.integrity.parameter.conversion.conversions.java.other.CalendarToSQLTime;
import de.gebit.integrity.parameter.conversion.conversions.java.other.CalendarToString;
import de.gebit.integrity.parameter.conversion.conversions.java.other.CalendarToTimestamp;
import de.gebit.integrity.parameter.conversion.conversions.java.other.DateToFormattedString;
import de.gebit.integrity.parameter.conversion.conversions.java.other.DateToSQLDate;
import de.gebit.integrity.parameter.conversion.conversions.java.other.DateToSQLTime;
Expand Down Expand Up @@ -200,6 +201,7 @@ protected void initializeConversions() {
addConversion(BooleanToFormattedString.class);
addConversion(DateToString.class);
addConversion(DateToFormattedString.class);
addConversion(CalendarToTimestamp.class);
addConversion(CalendarToDate.class);
addConversion(CalendarToSQLDate.class);
addConversion(CalendarToSQLTime.class);
Expand Down
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());
}

}

0 comments on commit 68171b4

Please sign in to comment.