Set client information in Sone builder.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / impl / AbstractSoneBuilder.java
index 140fbd5..878ba8d 100644 (file)
@@ -2,6 +2,7 @@ package net.pterodactylus.sone.data.impl;
 
 import static com.google.common.base.Preconditions.checkState;
 
+import net.pterodactylus.sone.data.Client;
 import net.pterodactylus.sone.database.SoneBuilder;
 import net.pterodactylus.sone.freenet.wot.Identity;
 
@@ -17,6 +18,7 @@ public abstract class AbstractSoneBuilder implements SoneBuilder {
 
        protected String id;
        protected boolean local;
+       protected Client client;
 
        @Override
        public SoneBuilder by(String id) {
@@ -30,8 +32,15 @@ public abstract class AbstractSoneBuilder implements SoneBuilder {
                return this;
        }
 
+       @Override
+       public SoneBuilder using(Client client) {
+               this.client = client;
+               return this;
+       }
+
        protected void validate() throws IllegalStateException {
                checkState(id != null, "id must not be null");
+               checkState(client != null, "client must not be null");
        }
 
 }