Browse Source

重写对象clone 方法

scott 7 years ago
parent
commit
f66eb77f95
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/main/java/com/bjlt/spider/entity/SearchRequestAfterOta.java

+ 11 - 1
src/main/java/com/bjlt/spider/entity/SearchRequestAfterOta.java

@@ -21,7 +21,7 @@ import java.util.Set;
 @Builder
 @NoArgsConstructor
 @AllArgsConstructor
-public class SearchRequestAfterOta implements Serializable {
+public class SearchRequestAfterOta implements Serializable, Cloneable {
 
     private static final long serialVersionUID = -8383845837426832307L;
 
@@ -97,6 +97,16 @@ public class SearchRequestAfterOta implements Serializable {
      */
     private Integer childNum;
 
+    @Override
+    public Object clone() throws CloneNotSupportedException {
+        SearchRequestAfterOta ota = null;
 
 
+        try {
+            ota = (SearchRequestAfterOta) super.clone();
+        }catch(CloneNotSupportedException e) {
+            e.printStackTrace();
+        }
+        return ota;
+    }
 }