/*
- * 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.
package org.hedgecode.snooker.json;
+import java.io.Serializable;
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
* @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
+ );
}
}