package net.swisstech.arangodb.model;

import static net.swisstech.swissarmyknife.lang.Strings.isBlank;

import com.fasterxml.jackson.annotation.JsonCreator;

public enum CollectionType {

	DOCUMENT(2),
	EDGE(3);

	private final int id;

	private CollectionType(int id) {
		this.id = id;
	}

	/** jackson calls toString() to serialize */
	@Override
	public String toString() {
		System.out.println("CollectionType.toString " + id);
		return Integer.toString(id);
	}

	/** jackson calls this method to deserialize */
	@JsonCreator
	public static CollectionType create(String value) {
		System.out.println("CollectionType.create " + value);
		if (isBlank(value)) {
			return null;
		}

		int id = Integer.parseInt(value);
		for (CollectionType cp : values()) {
			if (cp.id == id) {
				return cp;
			}
		}

		return null;
	}
}

@@ -374,63 +374,8 @@
 ) %7B%0A
-%09%09System.out.println(%22CollectionType.toString %22 + id);%0A
 %09%09re
@@ -525,64 +525,8 @@
 ) %7B%0A
-%09%09System.out.println(%22CollectionType.create %22 + value);%0A
 %09%09if

remove test/debug output