[LIB-10] SerialVersionUID for Serializable classes
[snooker-score-api.git] / src / main / java / org / hedgecode / snooker / json / JsonCollectionEntity.java
index 3223323..11f300d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017. Developed by Hedgecode.
+ * Copyright (c) 2017-2020. Developed by Hedgecode.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
 
 package org.hedgecode.snooker.json;
 
+import java.io.Serializable;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.Iterator;
@@ -33,20 +34,26 @@ import org.hedgecode.snooker.api.IdEntity;
  * @author Dmitry Samoshin aka gotty
  */
 public abstract class JsonCollectionEntity<E extends IdEntity>
-        implements CollectionEntity<E>, JsonSerializable
+        implements CollectionEntity<E>, Serializable
 {
+    private static final long serialVersionUID = 6302642716627217361L;
+
     private final Map<Integer, E> entities = new LinkedHashMap<>();
 
-    protected JsonCollectionEntity(E[] entities) {
+    JsonCollectionEntity(E[] entities) {
         for (E entity : entities) {
             if (entity != null)
-                this.entities.put(entity.getId(), entity);
+                this.entities.put(
+                        entity.getId(), entity
+                );
         }
     }
 
-    protected JsonCollectionEntity(List<E> entities) {
+    JsonCollectionEntity(List<E> entities) {
         for (E entity : entities) {
-            this.entities.put(entity.getId(), entity);
+            this.entities.put(
+                    entity.getId(), entity
+            );
         }
     }