Some source code formatting to the id-strategies.
This commit is contained in:
parent
63b3eae101
commit
6e15d22eda
@ -6,7 +6,15 @@ import com.massivecraft.mcore.xlib.bson.types.ObjectId;
|
|||||||
public class IdStrategyOidGson extends IdStrategyAbstract<ObjectId, String>
|
public class IdStrategyOidGson extends IdStrategyAbstract<ObjectId, String>
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// IMPLEMENTATION
|
// INSTANCE & CONSTRUCT
|
||||||
|
// -------------------------------------------- //
|
||||||
|
|
||||||
|
private static IdStrategyOidGson i = new IdStrategyOidGson();
|
||||||
|
public static IdStrategyOidGson get() { return i; }
|
||||||
|
private IdStrategyOidGson() { super("oid", ObjectId.class, String.class); }
|
||||||
|
|
||||||
|
// -------------------------------------------- //
|
||||||
|
// OVERRIDE
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override public String localToRemote(Object local) { return ((ObjectId)local).toStringBabble(); }
|
@Override public String localToRemote(Object local) { return ((ObjectId)local).toStringBabble(); }
|
||||||
@ -18,22 +26,4 @@ public class IdStrategyOidGson extends IdStrategyAbstract<ObjectId, String>
|
|||||||
return ObjectId.get();
|
return ObjectId.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------//
|
|
||||||
// CONSTRUCTORS
|
|
||||||
//----------------------------------------------//
|
|
||||||
|
|
||||||
private IdStrategyOidGson()
|
|
||||||
{
|
|
||||||
super("oid", ObjectId.class, String.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// INSTANCE
|
|
||||||
// -------------------------------------------- //
|
|
||||||
|
|
||||||
protected static IdStrategyOidGson instance = new IdStrategyOidGson();
|
|
||||||
public static IdStrategyOidGson get()
|
|
||||||
{
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,15 @@ import com.massivecraft.mcore.xlib.bson.types.ObjectId;
|
|||||||
public class IdStrategyOidMongo extends IdStrategyAbstract<ObjectId, ObjectId>
|
public class IdStrategyOidMongo extends IdStrategyAbstract<ObjectId, ObjectId>
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// IMPLEMENTATION
|
// INSTANCE & CONSTRUCT
|
||||||
|
// -------------------------------------------- //
|
||||||
|
|
||||||
|
private static IdStrategyOidMongo i = new IdStrategyOidMongo();
|
||||||
|
public static IdStrategyOidMongo get() { return i; }
|
||||||
|
private IdStrategyOidMongo() { super("oid", ObjectId.class, ObjectId.class); }
|
||||||
|
|
||||||
|
// -------------------------------------------- //
|
||||||
|
// OVERRIDE
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override public ObjectId localToRemote(Object local) { return (ObjectId)local; }
|
@Override public ObjectId localToRemote(Object local) { return (ObjectId)local; }
|
||||||
@ -18,23 +26,4 @@ public class IdStrategyOidMongo extends IdStrategyAbstract<ObjectId, ObjectId>
|
|||||||
return ObjectId.get();
|
return ObjectId.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------//
|
|
||||||
// CONSTRUCTORS
|
|
||||||
//----------------------------------------------//
|
|
||||||
|
|
||||||
private IdStrategyOidMongo()
|
|
||||||
{
|
|
||||||
super("oid", ObjectId.class, ObjectId.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// INSTANCE
|
|
||||||
// -------------------------------------------- //
|
|
||||||
|
|
||||||
protected static IdStrategyOidMongo instance = new IdStrategyOidMongo();
|
|
||||||
public static IdStrategyOidMongo get()
|
|
||||||
{
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,15 @@ import com.massivecraft.mcore.store.CollInterface;
|
|||||||
public class IdStrategyUuidMongoAndGson extends IdStrategyAbstract<UUID, String>
|
public class IdStrategyUuidMongoAndGson extends IdStrategyAbstract<UUID, String>
|
||||||
{
|
{
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
// IMPLEMENTATION
|
// INSTANCE & CONSTRUCT
|
||||||
|
// -------------------------------------------- //
|
||||||
|
|
||||||
|
private static IdStrategyUuidMongoAndGson i = new IdStrategyUuidMongoAndGson();
|
||||||
|
public static IdStrategyUuidMongoAndGson get() { return i; }
|
||||||
|
private IdStrategyUuidMongoAndGson() { super("uuid", UUID.class, String.class); }
|
||||||
|
|
||||||
|
// -------------------------------------------- //
|
||||||
|
// OVERRIDE
|
||||||
// -------------------------------------------- //
|
// -------------------------------------------- //
|
||||||
|
|
||||||
@Override public String localToRemote(Object local) { return ((UUID)local).toString(); }
|
@Override public String localToRemote(Object local) { return ((UUID)local).toString(); }
|
||||||
@ -19,22 +27,4 @@ public class IdStrategyUuidMongoAndGson extends IdStrategyAbstract<UUID, String>
|
|||||||
return UUID.randomUUID();
|
return UUID.randomUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------//
|
|
||||||
// CONSTRUCTORS
|
|
||||||
//----------------------------------------------//
|
|
||||||
|
|
||||||
private IdStrategyUuidMongoAndGson()
|
|
||||||
{
|
|
||||||
super("uuid", UUID.class, String.class);
|
|
||||||
}
|
|
||||||
|
|
||||||
// -------------------------------------------- //
|
|
||||||
// INSTANCE
|
|
||||||
// -------------------------------------------- //
|
|
||||||
|
|
||||||
protected static IdStrategyUuidMongoAndGson instance = new IdStrategyUuidMongoAndGson();
|
|
||||||
public static IdStrategyUuidMongoAndGson get()
|
|
||||||
{
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user