}
return new ArtifactAttribute(name, values);
}
private static LockfileArtifact parseArtifact(JsonParser parser) throws IOException {
ArtifactHash hash = null;
Integer size = null;
Set<ArtifactLocation> locations = null;
Set<ArtifactAttribute> attributes = null;
String filename = null;
assert (parser.getCurrentToken() == JsonToken.START_OBJECT);
while (parser.nextToken() != JsonToken.END_OBJECT) {
assert (parser.getCurrentToken() == JsonToken.FIELD_NAME);
String fieldName = parser.getCurrentName();
// Get value or array start token
parser.nextToken();
if (fieldName.equals("hash")) {
hash = new ArtifactHash(parser.getValueAsString());
} else if (fieldName.equals("size")) {
size = parser.getValueAsInt();
} else if (fieldName.equals("locations")) {
locations = new HashSet<ArtifactLocation>();
assert (parser.getCurrentToken() == JsonToken.START_ARRAY);