From eade36e741b4833d7dceed65f693ecc17e11c954 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Wed, 20 Dec 2017 13:54:54 -0500 Subject: [PATCH] Serializable MappingResult(s) Issue: SWF-1715 --- .../binding/mapping/MappingResult.java | 19 ++++++++++++++++++- .../binding/mapping/MappingResults.java | 5 +++-- .../results/AbstractMappingResult.java | 5 +++-- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResult.java b/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResult.java index caf3e134..377214aa 100644 --- a/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResult.java +++ b/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResult.java @@ -1,12 +1,29 @@ +/* + * Copyright 2004-2017 the original author or authors. + * + * 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.springframework.binding.mapping; +import java.io.Serializable; + /** * A single data mapping result. Each result has a unique {@link #getCode() code}, and provides context about the result * of a single data mapping operation. * * @author Keith Donald */ -public interface MappingResult { +public interface MappingResult extends Serializable { /** * The mapping that executed for which this result pertains to. diff --git a/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResults.java b/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResults.java index ed75122b..5011bddb 100644 --- a/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResults.java +++ b/spring-binding/src/main/java/org/springframework/binding/mapping/MappingResults.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2012 the original author or authors. + * Copyright 2004-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,6 +15,7 @@ */ package org.springframework.binding.mapping; +import java.io.Serializable; import java.util.List; /** @@ -22,7 +23,7 @@ import java.util.List; * * @author Keith Donald */ -public interface MappingResults { +public interface MappingResults extends Serializable { /** * The source object that was mapped from. diff --git a/spring-binding/src/main/java/org/springframework/binding/mapping/results/AbstractMappingResult.java b/spring-binding/src/main/java/org/springframework/binding/mapping/results/AbstractMappingResult.java index c9114256..9c864251 100644 --- a/spring-binding/src/main/java/org/springframework/binding/mapping/results/AbstractMappingResult.java +++ b/spring-binding/src/main/java/org/springframework/binding/mapping/results/AbstractMappingResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2004-2008 the original author or authors. + * Copyright 2004-2012 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,8 @@ import org.springframework.core.style.ToStringCreator; */ public abstract class AbstractMappingResult implements MappingResult { - private Mapping mapping; + private transient Mapping mapping; + /** * Creates a new mapping result.