Home›Java›Mods›MongoDB Java Object Builder
ModsJava

MongoDB Java Object Builder

Minecraft Java mod. Download on the author's site.

⬇ Download on Spigot
ObjectBuilder

First of all: The ObjectBuilder is a tool for developers. If you aren't a developer this is probably not interesting for you.

Features
Installation
  1. Clone (git): https://bitbucket.org/Jobi/objectbuilder/overview
  2. Compile it using maven
  3. Add dependency to your maven project
Code (Text):
<dependency>
    <groupId>com.spleefleague</groupId>
    <artifactId>ObjectBuilder</artifactId>
    <version>1.1</version>
</dependency>
API Usage
Saving Objects
Code (Text):
ObjectBuilder.save(customPlayer, customPlayerCollection);
Loading Objects
Code (Text):
//Requires the DBObject (MongoDB) of the object you want to load
CustomPlayer cp = ObjectBuilder.load(customPlayerdbo, CustomPlayer.class);
Creating custom objects
The next part is easier to explain with an example class.
Code (Text):
public class CustomPlayer extends DBEntity implements DBLoadable, DBSaveable {
 
    @DBLoad(fieldName = "username", priority = 10)
    private String name;
    @DBLoad(fieldName = "uuid", typeConverter = TypeConverter.UUIDStringConverter.class, priority = 10)
    private UUID uuid;
    @DBLoad(fieldName = "friends", typeConverter = TypeConverter.UUIDStringConverter.class)
    private Collection<UUID> friends;
    private Rank rank;//Rank is an enu
    @DBLoad(fieldName = "goals", typeConverter = TypeConverter.LocationConverter.class)
    private Location[] goals;

    public String getName() {
        return name;
    }
 
    public UUID getUUID() {
        return uuid;
    }
 
    @DBSave(fieldName = "rank")
    public Rank getRank() {
        return rank;
    }
 
    @DBLoad(fieldName = "rank")
    public void setRank(Rank rank) {
        this.rank = rank;
    }
 
    public Location[] getGoals() {
        return goals;
    }
}
Options in the annotations
Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

MongoDB Java Object Builder is a free Minecraft Java mod. Downloaded 316 times (via Spigot). Download it and open it directly in the game.

Explore more