Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
Copier | 37 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.mail.internal.thread.context; | |
21 | ||
22 | import org.apache.commons.lang3.exception.CloneFailedException; | |
23 | import org.xwiki.component.annotation.Role; | |
24 | ||
25 | /** | |
26 | * Generic component in charge of copying a given object of a given type. The main purpose of this is to add | |
27 | * {@link java.lang.Cloneable}-like behavior on objects that don't implement it. | |
28 | * <p> | |
29 | * Depending on the implementation, this can be different from {@link Object#clone()} as the result might need to be | |
30 | * modified to make sense on its own (e.g.: cloning a {@link javax.servlet.http.HttpServletRequest HttpServletRequest}). | |
31 | * | |
32 | * @param <T> the type of object to copy | |
33 | * @version $Id: 54554bdfaef1c52eb6d8e0900a952298207ce752 $ | |
34 | * @since 7.1M2 | |
35 | */ | |
36 | @Role | |
37 | public interface Copier<T> | |
38 | { | |
39 | /** | |
40 | * @param original the original object to copy | |
41 | * @return a copy of the original object | |
42 | * @throws CloneFailedException if problems occur | |
43 | */ | |
44 | T copy(T original) throws CloneFailedException; | |
45 | } |