Simplify Database Constructors. Use Setters.

This commit is contained in:
Olof Larsson 2015-12-01 11:23:56 +01:00
parent 4e6fdd9df4
commit a24463842d
2 changed files with 6 additions and 16 deletions

View File

@ -979,7 +979,7 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
// CONSTRUCT
// -------------------------------------------- //
public Coll(String name, Class<E> entityClass, Db db, Plugin plugin, boolean creative, boolean lowercasing, boolean sorted)
public Coll(String name, Class<E> entityClass, Db db, Plugin plugin)
{
// Setup the name and the parsed parts
this.name = name;
@ -995,9 +995,7 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
}
// WHAT DO WE HANDLE?
this.entityClass = entityClass;
this.creative = creative;
this.lowercasing = lowercasing;
this.entityClass = entityClass;
// SUPPORTING SYSTEM
this.plugin = plugin;
@ -1005,7 +1003,7 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
this.collDriverObject = db.createCollDriverObject(this);
// STORAGE
this.id2entity = (sorted) ? new ConcurrentSkipListMap<String, E>(NaturalOrderComparator.get()) : new ConcurrentHashMap<String, E>();
this.id2entity = new ConcurrentHashMap<String, E>();
// ENTITY DATA
this.identifiedModifications = new ConcurrentHashMap<String, Modification>();
@ -1016,11 +1014,6 @@ public class Coll<E extends Entity<E>> extends CollAbstract<E>
};
}
public Coll(String name, Class<E> entityClass, Db db, Plugin plugin)
{
this(name, entityClass, db, plugin, false, false, false);
}
@Override
public void init()
{

View File

@ -21,14 +21,11 @@ public class SenderColl<E extends SenderEntity<E>> extends Coll<E> implements Se
// CONSTRUCT
// -------------------------------------------- //
public SenderColl(String name, Class<E> entityClass, Db db, Plugin plugin, boolean creative, boolean lowercasing, boolean sorted)
{
super(name, entityClass, db, plugin, creative, lowercasing, sorted);
}
public SenderColl(String name, Class<E> entityClass, Db db, Plugin plugin)
{
super(name, entityClass, db, plugin, true, true, false);
super(name, entityClass, db, plugin);
this.setCreative(true);
this.setLowercasing(true);
}
// -------------------------------------------- //