Convert MaxMindResult's subdivisions to a list

This commit is contained in:
Colin McDonald 2016-06-22 19:45:49 -04:00
parent 5c3274d483
commit 9f2e4a63f0

View File

@ -1,5 +1,6 @@
package net.frozenorb.apiv3.maxmind;
import com.google.common.collect.ImmutableList;
import io.vertx.core.json.JsonObject;
import lombok.Getter;
@ -13,7 +14,7 @@ public final class MaxMindResult {
@Getter private MaxMindPostal postal;
@Getter private MaxMindTraits traits;
@Getter private MaxMindLocation location;
@Getter private MaxMindSubdivision[] subdivisions;
@Getter private List<MaxMindSubdivision> subdivisions;
@Getter private MaxMindCountry country;
@Getter private MaxMindRegisteredCountry registeredCountry;
@ -34,7 +35,7 @@ public final class MaxMindResult {
subdivisions.add(new MaxMindSubdivision((JsonObject) subdivision));
}
this.subdivisions = subdivisions.toArray(new MaxMindSubdivision[subdivisions.size()]);
this.subdivisions = ImmutableList.copyOf(subdivisions);
}
}