This commit is contained in:
Magnus Ulf 2019-05-13 13:09:35 +02:00
parent 33c201d6de
commit ef2f76c4c4
2 changed files with 5 additions and 1 deletions

View File

@ -120,11 +120,14 @@ public class TerritoryAccess
public static TerritoryAccess valueOf(String hostFactionId, Boolean hostFactionAllowed, Collection<String> grantedIds) public static TerritoryAccess valueOf(String hostFactionId, Boolean hostFactionAllowed, Collection<String> grantedIds)
{ {
if (hostFactionId == null) throw new NullPointerException("hostFactionId");
if (grantedIds == null) throw new NullPointerException("grantedIds");
return new TerritoryAccess(hostFactionId, hostFactionAllowed, grantedIds); return new TerritoryAccess(hostFactionId, hostFactionAllowed, grantedIds);
} }
public static TerritoryAccess valueOf(String hostFactionId) public static TerritoryAccess valueOf(String hostFactionId)
{ {
if (hostFactionId == null) throw new NullPointerException("hostFactionId");
return valueOf(hostFactionId, null, Collections.emptySet()); return valueOf(hostFactionId, null, Collections.emptySet());
} }

View File

@ -14,6 +14,7 @@ import com.massivecraft.factions.TerritoryAccess;
import com.massivecraft.massivecore.store.migrator.MigratorUtil; import com.massivecraft.massivecore.store.migrator.MigratorUtil;
import java.lang.reflect.Type; import java.lang.reflect.Type;
import java.util.Collections;
import java.util.Set; import java.util.Set;
public class TerritoryAccessAdapter implements JsonDeserializer<TerritoryAccess>, JsonSerializer<TerritoryAccess> public class TerritoryAccessAdapter implements JsonDeserializer<TerritoryAccess>, JsonSerializer<TerritoryAccess>
@ -57,7 +58,7 @@ public class TerritoryAccessAdapter implements JsonDeserializer<TerritoryAccess>
// Prepare variables // Prepare variables
String hostFactionId = null; String hostFactionId = null;
Boolean hostFactionAllowed = null; Boolean hostFactionAllowed = null;
Set<String> grantedIds = null; Set<String> grantedIds = Collections.emptySet();
// Read variables (test old values first) // Read variables (test old values first)
JsonElement element = null; JsonElement element = null;