Skip to content

Commit

Permalink
removed dependency on velocypack-module-jdk8 and velocypack-module-joda
Browse files Browse the repository at this point in the history
  • Loading branch information
rashtao committed Feb 5, 2021
1 parent fce2e77 commit e4540da
Show file tree
Hide file tree
Showing 7 changed files with 172 additions and 30 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a

## [Unreleased]

- removed dependencies on `velocypack-module-jdk8` and `velocypack-module-joda`
- upgraded dependency `com.arangodb:arangodb-java-driver:6.9.0`

## [3.4.1] - 2021-01-26

- upgraded dependency `com.arangodb:arangodb-java-driver:6.8.2`
Expand Down
18 changes: 0 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,14 +204,6 @@
<groupId>com.arangodb</groupId>
<artifactId>arangodb-java-driver</artifactId>
</dependency>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>velocypack-module-jdk8</artifactId>
</dependency>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>velocypack-module-joda</artifactId>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand Down Expand Up @@ -285,16 +277,6 @@
<artifactId>arangodb-java-driver</artifactId>
<version>6.9.0</version>
</dependency>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>velocypack-module-jdk8</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>velocypack-module-joda</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@

import com.arangodb.entity.BaseDocument;
import com.arangodb.entity.BaseEdgeDocument;
import com.arangodb.springframework.annotation.*;
import com.arangodb.springframework.annotation.Document;
import com.arangodb.springframework.annotation.Edge;
import com.arangodb.springframework.annotation.From;
import com.arangodb.springframework.annotation.Ref;
import com.arangodb.springframework.annotation.Relations;
import com.arangodb.springframework.annotation.To;
import com.arangodb.springframework.core.convert.resolver.LazyLoadingProxy;
import com.arangodb.springframework.core.convert.resolver.ReferenceResolver;
import com.arangodb.springframework.core.convert.resolver.RelationResolver;
Expand All @@ -35,7 +40,6 @@
import com.arangodb.velocypack.VPackSlice;
import com.arangodb.velocypack.ValueType;
import com.arangodb.velocypack.internal.util.DateUtil;
import com.arangodb.velocypack.module.jdk8.internal.util.JavaTimeUtil;
import org.springframework.core.CollectionFactory;
import org.springframework.core.convert.support.DefaultConversionService;
import org.springframework.core.convert.support.GenericConversionService;
Expand All @@ -61,9 +65,20 @@
import java.math.BigInteger;
import java.sql.Timestamp;
import java.text.ParseException;
import java.time.*;
import java.util.*;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;

/**
* @author Mark Vollmary
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* DISCLAIMER
*
* Copyright 2018 ArangoDB GmbH, Cologne, Germany
*
* 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.
*
* Copyright holder is ArangoDB GmbH, Cologne, Germany
*/

package com.arangodb.springframework.core.convert;

import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;

/**
* @author Mark Vollmary
*
*/
public class JavaTimeUtil {

private JavaTimeUtil() {
super();
}

public static String format(final Instant source) {
return DateTimeFormatter.ISO_INSTANT.format(source);
}

public static String format(final LocalDate source) {
return DateTimeFormatter.ISO_LOCAL_DATE.format(source);
}

public static String format(final OffsetDateTime source) {
return DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(source);
}

public static String format(final LocalDateTime source) {
return DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(source);
}

public static String format(final ZonedDateTime source) {
return DateTimeFormatter.ISO_ZONED_DATE_TIME.format(source);
}

public static Instant parseInstant(final CharSequence source) {
return Instant.parse(source);
}

public static LocalDate parseLocalDate(final CharSequence source) {
return LocalDate.parse(source);
}

public static LocalDateTime parseLocalDateTime(final CharSequence source) {
return LocalDateTime.parse(source);
}

public static OffsetDateTime parseOffsetDateTime(final CharSequence source) {
return OffsetDateTime.parse(source);
}

public static ZonedDateTime parseZonedDateTime(final CharSequence source) {
return ZonedDateTime.parse(source);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@

package com.arangodb.springframework.core.convert;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

import org.joda.time.DateTime;
import org.joda.time.Instant;
import org.joda.time.LocalDate;
Expand All @@ -34,11 +29,14 @@
import org.springframework.data.convert.WritingConverter;
import org.springframework.util.ClassUtils;

import com.arangodb.velocypack.module.joda.internal.util.JodaTimeUtil;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;


/**
* @author Mark Vollmary
*
*/
public class JodaTimeStringConverters {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* DISCLAIMER
*
* Copyright 2016 ArangoDB GmbH, Cologne, Germany
*
* 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.
*
* Copyright holder is ArangoDB GmbH, Cologne, Germany
*/

package com.arangodb.springframework.core.convert;

import org.joda.time.DateTime;
import org.joda.time.Instant;
import org.joda.time.LocalDate;
import org.joda.time.LocalDateTime;
import org.joda.time.format.ISODateTimeFormat;

public final class JodaTimeUtil {

private JodaTimeUtil() {
}

public static String format(final Instant source) {
return ISODateTimeFormat.dateTime().print(source);
}

public static String format(final DateTime source) {
return ISODateTimeFormat.dateTime().print(source);
}

public static String format(final LocalDate source) {
return ISODateTimeFormat.yearMonthDay().print(source);
}

public static String format(final LocalDateTime source) {
return ISODateTimeFormat.dateTime().print(source);
}

public static Instant parseInstant(final String source) {
return Instant.parse(source);
}

public static DateTime parseDateTime(final String source) {
return DateTime.parse(source);
}

public static LocalDate parseLocalDate(final String source) {
return LocalDate.parse(source);
}

public static LocalDateTime parseLocalDateTime(final String source) {
return LocalDateTime.parse(source);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@
import org.springframework.data.convert.WritingConverter;

import com.arangodb.velocypack.internal.util.DateUtil;
import com.arangodb.velocypack.module.jdk8.internal.util.JavaTimeUtil;

/**
* These date and java.time converters are necessary to override (possibly existing) Spring converters.
Expand Down

0 comments on commit e4540da

Please sign in to comment.