From 5fd0c3e3d475db1e273073028da17b67c2a17bf2 Mon Sep 17 00:00:00 2001 From: Filip Hrisafov Date: Wed, 24 Aug 2016 23:45:53 +0200 Subject: [PATCH] remove builtin methods; remove test which is not needed anymore --- .../model/source/builtin/DateToSqlDate.java | 69 ------------- .../model/source/builtin/DateToSqlTime.java | 72 -------------- .../source/builtin/DateToSqlTimestamp.java | 73 -------------- .../model/source/builtin/DateToSqlDate.ftl | 27 ------ .../model/source/builtin/DateToSqlTime.ftl | 27 ------ .../source/builtin/DateToSqlTimestamp.ftl | 27 ------ .../ap/test/builtin/BuiltInTest.java | 97 +------------------ .../ap/test/builtin/bean/SqlTimeProperty.java | 37 ------- .../builtin/bean/SqlTimestampProperty.java | 37 ------- .../builtin/mapper/DateToSqlDateMapper.java | 38 -------- .../ap/test/builtin/mapper/SqlTimeMapper.java | 38 -------- .../builtin/mapper/SqlTimestampMapper.java | 38 -------- 12 files changed, 1 insertion(+), 579 deletions(-) delete mode 100644 processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.java delete mode 100644 processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.java delete mode 100644 processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.java delete mode 100644 processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.ftl delete mode 100644 processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.ftl delete mode 100644 processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.ftl delete mode 100644 processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimeProperty.java delete mode 100644 processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimestampProperty.java delete mode 100644 processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/DateToSqlDateMapper.java delete mode 100644 processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimeMapper.java delete mode 100644 processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimestampMapper.java diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.java b/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.java deleted file mode 100644 index 7062b8516..000000000 --- a/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mapstruct.ap.internal.model.source.builtin; - -import static org.mapstruct.ap.internal.util.Collections.asSet; - -import java.util.Date; -import java.util.Set; - -import org.mapstruct.ap.internal.model.common.Parameter; -import org.mapstruct.ap.internal.model.common.Type; -import org.mapstruct.ap.internal.model.common.TypeFactory; - -/** - * @author Filip Hrisafov - */ -public class DateToSqlDate extends BuiltInMethod { - - private final Parameter parameter; - private final Type returnType; - private final Set importTypes; - - public DateToSqlDate(TypeFactory typeFactory) { - this.parameter = new Parameter( "date", typeFactory.getType( Date.class ) ); - this.returnType = typeFactory.getType( java.sql.Date.class ); - - this.importTypes = asSet( - parameter.getType() - ); - } - - @Override - public boolean doTypeVarsMatch(Type parameter, Type returnType) { - //We must make sure that there is only a match when the types are equal. The reason for this is to avoid - //ambiguous problems, when the return type is java.util.Date - return getReturnType().equals( returnType ); - } - - @Override - public Set getImportTypes() { - return importTypes; - } - - @Override - public Parameter getParameter() { - return parameter; - } - - @Override - public Type getReturnType() { - return returnType; - } -} diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.java b/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.java deleted file mode 100644 index e05166e76..000000000 --- a/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.java +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mapstruct.ap.internal.model.source.builtin; - -import static org.mapstruct.ap.internal.util.Collections.asSet; - -import java.sql.Time; -import java.util.Date; -import java.util.Set; - -import org.mapstruct.ap.internal.model.common.Parameter; -import org.mapstruct.ap.internal.model.common.Type; -import org.mapstruct.ap.internal.model.common.TypeFactory; - - -/** - * @author Filip Hrisafov - */ -public class DateToSqlTime extends BuiltInMethod { - - private final Parameter parameter; - private final Type returnType; - private final Set importTypes; - - public DateToSqlTime(TypeFactory typeFactory) { - this.parameter = new Parameter( "date", typeFactory.getType( Date.class ) ); - this.returnType = typeFactory.getType( Time.class ); - - this.importTypes = asSet( - parameter.getType(), - returnType - ); - } - - @Override - public boolean doTypeVarsMatch(Type parameter, Type returnType) { - //We must make sure that there is only a match when the types are equal. The reason for this is to avoid - //ambiguous problems, when the return type is java.util.Date - return getReturnType().equals( returnType ); - } - - @Override - public Set getImportTypes() { - return importTypes; - } - - @Override - public Parameter getParameter() { - return parameter; - } - - @Override - public Type getReturnType() { - return returnType; - } -} diff --git a/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.java b/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.java deleted file mode 100644 index a94252550..000000000 --- a/processor/src/main/java/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.java +++ /dev/null @@ -1,73 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.mapstruct.ap.internal.model.source.builtin; - -import static org.mapstruct.ap.internal.util.Collections.asSet; - -import java.sql.Timestamp; -import java.util.Date; -import java.util.Set; - -import org.mapstruct.ap.internal.model.common.Parameter; -import org.mapstruct.ap.internal.model.common.Type; -import org.mapstruct.ap.internal.model.common.TypeFactory; - - -/** - * @author Filip Hrisafov - */ -public class DateToSqlTimestamp extends BuiltInMethod { - - private final Parameter parameter; - private final Type returnType; - private final Set importTypes; - - public DateToSqlTimestamp(TypeFactory typeFactory) { - this.parameter = new Parameter( "date", typeFactory.getType( Date.class ) ); - this.returnType = typeFactory.getType( Timestamp.class ); - - this.importTypes = asSet( - parameter.getType(), - returnType - ); - } - - @Override - public boolean doTypeVarsMatch(Type parameter, Type returnType) { - //We must make sure that there is only a match when the types are equal. The reason for this is to avoid - //ambiguous problems, when the return type is java.util.Date - return getReturnType().equals( returnType ); - } - - @Override - public Set getImportTypes() { - return importTypes; - } - - @Override - public Parameter getParameter() { - return parameter; - } - - @Override - public Type getReturnType() { - return returnType; - } -} diff --git a/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.ftl b/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.ftl deleted file mode 100644 index c5b8255eb..000000000 --- a/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlDate.ftl +++ /dev/null @@ -1,27 +0,0 @@ -<#-- - - Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - and/or other contributors as indicated by the @authors tag. See the - copyright.txt file in the distribution for a full listing of all - contributors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -private java.sql.Date ${name}( Date date ) { - if ( date == null ) { - return null; - } - - return new java.sql.Date(date.getTime()); -} \ No newline at end of file diff --git a/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.ftl b/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.ftl deleted file mode 100644 index a31ad02a0..000000000 --- a/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTime.ftl +++ /dev/null @@ -1,27 +0,0 @@ -<#-- - - Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - and/or other contributors as indicated by the @authors tag. See the - copyright.txt file in the distribution for a full listing of all - contributors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -private Time ${name}( Date date ) { - if ( date == null ) { - return null; - } - - return new Time(date.getTime()); -} \ No newline at end of file diff --git a/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.ftl b/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.ftl deleted file mode 100644 index a8e691b3b..000000000 --- a/processor/src/main/resources/org/mapstruct/ap/internal/model/source/builtin/DateToSqlTimestamp.ftl +++ /dev/null @@ -1,27 +0,0 @@ -<#-- - - Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - and/or other contributors as indicated by the @authors tag. See the - copyright.txt file in the distribution for a full listing of all - contributors. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - ---> -private Timestamp ${name}( Date date ) { - if ( date == null ) { - return null; - } - - return new Timestamp(date.getTime()); -} \ No newline at end of file diff --git a/processor/src/test/java/org/mapstruct/ap/test/builtin/BuiltInTest.java b/processor/src/test/java/org/mapstruct/ap/test/builtin/BuiltInTest.java index c6b09c0e3..d424e168a 100644 --- a/processor/src/test/java/org/mapstruct/ap/test/builtin/BuiltInTest.java +++ b/processor/src/test/java/org/mapstruct/ap/test/builtin/BuiltInTest.java @@ -20,8 +20,6 @@ package org.mapstruct.ap.test.builtin; import static org.assertj.core.api.Assertions.assertThat; -import java.sql.Time; -import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.ZoneId; @@ -54,8 +52,6 @@ import org.mapstruct.ap.test.builtin.bean.DateProperty; import org.mapstruct.ap.test.builtin.bean.JaxbElementListProperty; import org.mapstruct.ap.test.builtin.bean.JaxbElementProperty; import org.mapstruct.ap.test.builtin.bean.SqlDateProperty; -import org.mapstruct.ap.test.builtin.bean.SqlTimeProperty; -import org.mapstruct.ap.test.builtin.bean.SqlTimestampProperty; import org.mapstruct.ap.test.builtin.bean.StringListProperty; import org.mapstruct.ap.test.builtin.bean.StringProperty; import org.mapstruct.ap.test.builtin.bean.XmlGregorianCalendarProperty; @@ -66,14 +62,11 @@ import org.mapstruct.ap.test.builtin.mapper.CalendarToDateMapper; import org.mapstruct.ap.test.builtin.mapper.CalendarToStringMapper; import org.mapstruct.ap.test.builtin.mapper.CalendarToXmlGregCalMapper; import org.mapstruct.ap.test.builtin.mapper.DateToCalendarMapper; -import org.mapstruct.ap.test.builtin.mapper.DateToSqlDateMapper; import org.mapstruct.ap.test.builtin.mapper.DateToXmlGregCalMapper; import org.mapstruct.ap.test.builtin.mapper.IterableSourceTargetMapper; import org.mapstruct.ap.test.builtin.mapper.JaxbListMapper; import org.mapstruct.ap.test.builtin.mapper.JaxbMapper; import org.mapstruct.ap.test.builtin.mapper.MapSourceTargetMapper; -import org.mapstruct.ap.test.builtin.mapper.SqlTimeMapper; -import org.mapstruct.ap.test.builtin.mapper.SqlTimestampMapper; import org.mapstruct.ap.test.builtin.mapper.StringToCalendarMapper; import org.mapstruct.ap.test.builtin.mapper.StringToXmlGregCalMapper; import org.mapstruct.ap.test.builtin.mapper.XmlGregCalToCalendarMapper; @@ -94,8 +87,6 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner; IterableTarget.class, MapTarget.class, SqlDateProperty.class, - SqlTimeProperty.class, - SqlTimestampProperty.class, CalendarProperty.class, DateProperty.class, JaxbElementListProperty.class, @@ -111,9 +102,6 @@ import org.mapstruct.ap.testutil.runner.AnnotationProcessorTestRunner; CalendarToXmlGregCalMapper.class, DateToCalendarMapper.class, DateToXmlGregCalMapper.class, - DateToSqlDateMapper.class, - SqlTimeMapper.class, - SqlTimestampMapper.class, IterableSourceTargetMapper.class, JaxbListMapper.class, JaxbMapper.class, @@ -270,7 +258,7 @@ public class BuiltInTest { DateProperty target = CalendarToDateMapper.INSTANCE.map( source ); assertThat( target ).isNotNull(); - assertThat( target.getProp() ).isNotNull().isInstanceOf( Date.class ); + assertThat( target.getProp() ).isNotNull(); assertThat( target.getProp() ).isEqualTo( createCalendar( "02.03.1999" ).getTime() ); } @@ -361,89 +349,6 @@ public class BuiltInTest { assertThat( target.getProp() ).isEqualTo( createCalendar( "02.03.1999" ) ); } - @Test - public void shouldApplyBuiltInOnDateToSqlDate() throws ParseException { - assertThat( DateToSqlDateMapper.INSTANCE.toTargetWithSqlDate( null ) ).isNull(); - DateProperty source = new DateProperty(); - source.setProp( createDate( "31-08-1982 10:20:56" ) ); - - SqlDateProperty target = DateToSqlDateMapper.INSTANCE.toTargetWithSqlDate( source ); - - assertThat( target ).isNotNull(); - assertThat( target.getProp() ).isNotNull().isInstanceOf( java.sql.Date.class ); - assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31" ); - } - - @Test - public void shouldUseSqlDateWhenMappingToDate() throws ParseException { - assertThat( DateToSqlDateMapper.INSTANCE.fromSqlDate( null ) ).isNull(); - - SqlDateProperty source = new SqlDateProperty(); - source.setProp( new java.sql.Date( createDate( "31-08-1982 10:20:56" ).getTime() ) ); - - DateProperty target = DateToSqlDateMapper.INSTANCE.fromSqlDate( source ); - assertThat( target ).isNotNull(); - assertThat( target.getProp() ).isNotNull(); - assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31" ); - } - - @Test - public void shouldApplyBuiltInOnDateToSqlTime() throws ParseException { - SqlTimeMapper mapper = SqlTimeMapper.INSTANCE; - assertThat( mapper.map( null ) ).isNull(); - DateProperty source = new DateProperty(); - source.setProp( createDate( "31-08-1982 10:20:56" ) ); - - SqlTimeProperty target = mapper.map( source ); - - assertThat( target ).isNotNull(); - assertThat( target.getProp() ).isNotNull(); - assertThat( target.getProp().toString() ).isEqualTo( "10:20:56" ); - } - - @Test - public void shouldUseSqlTimeWhenMappingToDate() throws ParseException { - SqlTimeMapper mapper = SqlTimeMapper.INSTANCE; - assertThat( mapper.fromTime( null ) ).isNull(); - - SqlTimeProperty source = new SqlTimeProperty(); - source.setProp( new Time( createDate( "31-08-1982 10:20:56" ).getTime() ) ); - - DateProperty target = mapper.fromTime( source ); - assertThat( target ).isNotNull(); - assertThat( target.getProp() ).isNotNull(); - assertThat( target.getProp().toString() ).isEqualTo( "10:20:56" ); - } - - @Test - public void shouldApplyBuiltInOnDateToSqlTimestamp() throws ParseException { - SqlTimestampMapper mapper = SqlTimestampMapper.INSTANCE; - assertThat( mapper.map( null ) ).isNull(); - DateProperty source = new DateProperty(); - source.setProp( createDate( "31-08-1982 10:20:56" ) ); - - SqlTimestampProperty target = mapper.map( source ); - - assertThat( target ).isNotNull(); - assertThat( target.getProp() ).isNotNull(); - assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31 10:20:56.0" ); - } - - @Test - public void shouldUseSqlTimestampWhenMappingToDate() throws ParseException { - SqlTimestampMapper mapper = SqlTimestampMapper.INSTANCE; - assertThat( mapper.fromTimestamp( null ) ).isNull(); - - SqlTimestampProperty source = new SqlTimestampProperty(); - source.setProp( new Timestamp( createDate( "31-08-1982 10:20:56" ).getTime() ) ); - - DateProperty target = mapper.fromTimestamp( source ); - assertThat( target ).isNotNull(); - assertThat( target.getProp() ).isNotNull(); - assertThat( target.getProp().toString() ).isEqualTo( "1982-08-31 10:20:56.0" ); - } - - private JAXBElement createJaxb(String test) { return new JAXBElement( new QName( "www.mapstruct.org", "test" ), String.class, test ); } diff --git a/processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimeProperty.java b/processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimeProperty.java deleted file mode 100644 index 358f8ca2e..000000000 --- a/processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimeProperty.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mapstruct.ap.test.builtin.bean; - -import java.sql.Time; - -/** - * @author Filip Hrisafov - */ -public class SqlTimeProperty { - - private Time prop; - - public Time getProp() { - return prop; - } - - public void setProp(Time prop) { - this.prop = prop; - } -} diff --git a/processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimestampProperty.java b/processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimestampProperty.java deleted file mode 100644 index 3c68b4e9d..000000000 --- a/processor/src/test/java/org/mapstruct/ap/test/builtin/bean/SqlTimestampProperty.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mapstruct.ap.test.builtin.bean; - -import java.sql.Timestamp; - -/** - * @author Filip Hrisafov - */ -public class SqlTimestampProperty { - - private Timestamp prop; - - public Timestamp getProp() { - return prop; - } - - public void setProp(Timestamp prop) { - this.prop = prop; - } -} diff --git a/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/DateToSqlDateMapper.java b/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/DateToSqlDateMapper.java deleted file mode 100644 index dc0f18e3d..000000000 --- a/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/DateToSqlDateMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mapstruct.ap.test.builtin.mapper; - -import org.mapstruct.Mapper; -import org.mapstruct.ap.test.builtin.bean.DateProperty; -import org.mapstruct.ap.test.builtin.bean.SqlDateProperty; -import org.mapstruct.factory.Mappers; - -/** - * @author Andreas Gudian - * - */ -@Mapper -public interface DateToSqlDateMapper { - - DateToSqlDateMapper INSTANCE = Mappers.getMapper( DateToSqlDateMapper.class ); - - SqlDateProperty toTargetWithSqlDate(DateProperty source); - - DateProperty fromSqlDate(SqlDateProperty source); -} diff --git a/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimeMapper.java b/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimeMapper.java deleted file mode 100644 index 45f496c1c..000000000 --- a/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimeMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mapstruct.ap.test.builtin.mapper; - -import org.mapstruct.Mapper; -import org.mapstruct.ap.test.builtin.bean.DateProperty; -import org.mapstruct.ap.test.builtin.bean.SqlTimeProperty; -import org.mapstruct.factory.Mappers; - -/** - * @author Andreas Gudian - * - */ -@Mapper -public interface SqlTimeMapper { - - SqlTimeMapper INSTANCE = Mappers.getMapper( SqlTimeMapper.class ); - - SqlTimeProperty map(DateProperty source); - - DateProperty fromTime(SqlTimeProperty source); -} diff --git a/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimestampMapper.java b/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimestampMapper.java deleted file mode 100644 index b6bc11d61..000000000 --- a/processor/src/test/java/org/mapstruct/ap/test/builtin/mapper/SqlTimestampMapper.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Copyright 2012-2016 Gunnar Morling (http://www.gunnarmorling.de/) - * and/or other contributors as indicated by the @authors tag. See the - * copyright.txt file in the distribution for a full listing of all - * contributors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.mapstruct.ap.test.builtin.mapper; - -import org.mapstruct.Mapper; -import org.mapstruct.ap.test.builtin.bean.DateProperty; -import org.mapstruct.ap.test.builtin.bean.SqlTimestampProperty; -import org.mapstruct.factory.Mappers; - -/** - * @author Andreas Gudian - * - */ -@Mapper -public interface SqlTimestampMapper { - - SqlTimestampMapper INSTANCE = Mappers.getMapper( SqlTimestampMapper.class ); - - SqlTimestampProperty map(DateProperty source); - - DateProperty fromTimestamp(SqlTimestampProperty source); -}