🔥 Remove unnecessary imports
[Sone.git] / src / main / java / net / pterodactylus / sone / data / Profile.java
index 76e0acf..34246cb 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Sone - Profile.java - Copyright Â© 2010–2019 David Roden
+ * Sone - Profile.java - Copyright Â© 2010–2020 David Roden
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -19,7 +19,6 @@ package net.pterodactylus.sone.data;
 
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
 import static java.nio.charset.StandardCharsets.UTF_8;
 
 import java.util.ArrayList;
@@ -127,7 +126,7 @@ public class Profile implements Fingerprintable {
         */
        @Nonnull
        public Profile setFirstName(@Nullable String firstName) {
-               this.firstName = firstName;
+               this.firstName = "".equals(firstName) ? null : firstName;
                return this;
        }
 
@@ -150,7 +149,7 @@ public class Profile implements Fingerprintable {
         */
        @Nonnull
        public Profile setMiddleName(@Nullable String middleName) {
-               this.middleName = middleName;
+               this.middleName = "".equals(middleName) ? null : middleName;
                return this;
        }
 
@@ -173,7 +172,7 @@ public class Profile implements Fingerprintable {
         */
        @Nonnull
        public Profile setLastName(@Nullable String lastName) {
-               this.lastName = lastName;
+               this.lastName = "".equals(lastName) ? null : lastName;
                return this;
        }