Remove setIdentity() from Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / data / impl / AbstractSoneBuilder.java
1 package net.pterodactylus.sone.data.impl;
2
3 import static com.google.common.base.Preconditions.checkState;
4
5 import net.pterodactylus.sone.database.SoneBuilder;
6 import net.pterodactylus.sone.freenet.wot.Identity;
7
8 import com.google.common.base.Preconditions;
9 import com.google.inject.internal.util.$Preconditions;
10
11 /**
12  * Abstract {@link SoneBuilder} implementation.
13  *
14  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
15  */
16 public abstract class AbstractSoneBuilder implements SoneBuilder {
17
18         protected String id;
19         protected boolean local;
20
21         @Override
22         public SoneBuilder by(String id) {
23                 this.id = id;
24                 return this;
25         }
26
27         @Override
28         public SoneBuilder local() {
29                 local = true;
30                 return this;
31         }
32
33         protected void validate() throws IllegalStateException {
34                 checkState(id != null, "id must not be null");
35         }
36
37 }