Cleanup deprecations
This commit is contained in:
@@ -112,12 +112,6 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- AVRO -->
|
<!-- AVRO -->
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.avro</groupId>
|
|
||||||
<artifactId>avro</artifactId>
|
|
||||||
<version>${avro.version}</version>
|
|
||||||
<optional>true</optional>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.cloudevents</groupId>
|
<groupId>io.cloudevents</groupId>
|
||||||
<artifactId>cloudevents-spring</artifactId>
|
<artifactId>cloudevents-spring</artifactId>
|
||||||
@@ -211,24 +205,6 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.avro</groupId>
|
|
||||||
<artifactId>avro-maven-plugin</artifactId>
|
|
||||||
<version>${avro.version}</version>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<phase>generate-test-sources</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>schema</goal>
|
|
||||||
</goals>
|
|
||||||
<configuration>
|
|
||||||
<outputDirectory>${project.basedir}/target/generated-test-sources</outputDirectory>
|
|
||||||
<testOutputDirectory>${project.basedir}/target/generated-test-sources</testOutputDirectory>
|
|
||||||
<testSourceDirectory>${project.basedir}/src/test/resources/avro</testSourceDirectory>
|
|
||||||
</configuration>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@@ -35,11 +35,6 @@ public class GsonMapper extends JsonMapper {
|
|||||||
this.gson = gson;
|
this.gson = gson;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T> T toObject(String json, Type type) {
|
|
||||||
return this.fromJson(json, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString(Object value) {
|
public String toString(Object value) {
|
||||||
return this.gson.toJson(value);
|
return this.gson.toJson(value);
|
||||||
|
|||||||
@@ -38,11 +38,6 @@ public class JacksonMapper extends JsonMapper {
|
|||||||
this.mapper = mapper;
|
this.mapper = mapper;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public <T> T toObject(String json, Type type) {
|
|
||||||
return this.fromJson(json, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void configureObjectMapper(Consumer<ObjectMapper> configurer) {
|
public void configureObjectMapper(Consumer<ObjectMapper> configurer) {
|
||||||
configurer.accept(mapper);
|
configurer.accept(mapper);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,6 @@ import org.apache.commons.logging.Log;
|
|||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
import org.springframework.cloud.function.context.catalog.FunctionTypeUtils;
|
import org.springframework.cloud.function.context.catalog.FunctionTypeUtils;
|
||||||
import org.springframework.core.ResolvableType;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Dave Syer
|
* @author Dave Syer
|
||||||
* @author Oleg Zhurakousky
|
* @author Oleg Zhurakousky
|
||||||
@@ -38,32 +36,6 @@ public abstract class JsonMapper {
|
|||||||
|
|
||||||
private static Log logger = LogFactory.getLog(JsonMapper.class);
|
private static Log logger = LogFactory.getLog(JsonMapper.class);
|
||||||
|
|
||||||
/**
|
|
||||||
* @param <T> type for list arguments
|
|
||||||
* @param json JSON input
|
|
||||||
* @param type type of list arguments
|
|
||||||
* @return list of elements
|
|
||||||
* @deprecated since v2.0 in favor of {@link #toObject(String, Type)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
<T> List<T> toList(String json, Class<T> type) {
|
|
||||||
Type actualType = (json.startsWith("[") && !List.class.isAssignableFrom(type))
|
|
||||||
? ResolvableType.forClassWithGenerics(ArrayList.class, (Class<?>) type).getType()
|
|
||||||
: type;
|
|
||||||
return toObject(json, actualType);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param <T> return type
|
|
||||||
* @param json JSON input
|
|
||||||
* @param type type
|
|
||||||
* @return object
|
|
||||||
* @since 2.0
|
|
||||||
* @deprecated since v3.0.4 in favor of {@link #fromJson(Object, Type)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
abstract <T> T toObject(String json, Type type);
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public <T> T fromJson(Object json, Type type) {
|
public <T> T fromJson(Object json, Type type) {
|
||||||
if (json instanceof Collection<?>) {
|
if (json instanceof Collection<?>) {
|
||||||
@@ -110,18 +82,6 @@ public abstract class JsonMapper {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param <T> type for list arguments
|
|
||||||
* @param json JSON input
|
|
||||||
* @param type type of list arguments
|
|
||||||
* @return single object
|
|
||||||
* @deprecated since v2.0 in favor of {@link #toObject(String, Type)}
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
<T> T toSingle(String json, Class<T> type) {
|
|
||||||
return toObject(json, type);
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract String toString(Object value);
|
public abstract String toString(Object value);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user