✅ Add tests for WOTC.getTrust
[Sone.git] / src / main / java / net / pterodactylus / sone / database / memory / MemorySoneBuilder.java
1 package net.pterodactylus.sone.database.memory;
2
3 import net.pterodactylus.sone.data.Sone;
4 import net.pterodactylus.sone.data.impl.SoneImpl;
5 import net.pterodactylus.sone.data.impl.AbstractSoneBuilder;
6 import net.pterodactylus.sone.database.Database;
7
8 /**
9  * Memory-based {@link AbstractSoneBuilder} implementation.
10  */
11 public class MemorySoneBuilder extends AbstractSoneBuilder {
12
13         private final Database database;
14
15         public MemorySoneBuilder(Database database) {
16                 this.database = database;
17         }
18
19         @Override
20         public Sone build() throws IllegalStateException {
21                 validate();
22                 return new SoneImpl(database, identity, local);
23         }
24
25 }