// Path: friendly-id/src/main/java/com/devskiller/friendly_id/FriendlyId.java
// public class FriendlyId {
// 
// 	/**
// 	 * Create FriendlyId id
// 	 *
// 	 * @return Friendly Id encoded UUID
// 	 */
// 	public static String createFriendlyId() {
// 		return Url62.encode(UUID.randomUUID());
// 	}
// 
// 	/**
// 	 * Encode UUID to FriendlyId id
// 	 *
// 	 * @param uuid UUID to be encoded
// 	 * @return Friendly Id encoded UUID
// 	 */
// 	public static String toFriendlyId(UUID uuid) {
// 		return Url62.encode(uuid);
// 	}
// 
// 	/**
// 	 * Decode Friendly Id to UUID
// 	 *
// 	 * @param friendlyId encoded UUID
// 	 * @return decoded UUID
// 	 */
// 	public static UUID toUuid(String friendlyId) {
// 		return Url62.decode(friendlyId);
// 	}
// 
// }


import java.io.IOException;
import java.util.UUID;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.UUIDDeserializer;
import com.devskiller.friendly_id.FriendlyId;
package com.devskiller.friendly_id.jackson;




public class FriendlyIdDeserializer extends UUIDDeserializer {

	@Override
	public UUID deserialize(JsonParser parser, DeserializationContext deserializationContext) throws IOException {

		JsonToken token = parser.getCurrentToken();
		if (token == JsonToken.VALUE_STRING) {
			String string = parser.getValueAsString().trim();
			if (looksLikeUuid(string)) {
				return super.deserialize(parser, deserializationContext);
			} else {
// Path: friendly-id/src/main/java/com/devskiller/friendly_id/FriendlyId.java
// public class FriendlyId {
// 
// 	/**
// 	 * Create FriendlyId id
// 	 *
// 	 * @return Friendly Id encoded UUID
// 	 */
// 	public static String createFriendlyId() {
// 		return Url62.encode(UUID.randomUUID());
// 	}
// 
// 	/**
// 	 * Encode UUID to FriendlyId id
// 	 *
// 	 * @param uuid UUID to be encoded
// 	 * @return Friendly Id encoded UUID
// 	 */
// 	public static String toFriendlyId(UUID uuid) {
// 		return Url62.encode(uuid);
// 	}
// 
// 	/**
// 	 * Decode Friendly Id to UUID
// 	 *
// 	 * @param friendlyId encoded UUID
// 	 * @return decoded UUID
// 	 */
// 	public static UUID toUuid(String friendlyId) {
// 		return Url62.decode(friendlyId);
// 	}
// 
// }


// Path: friendly-id-jackson-datatype/src/main/java/com/devskiller/friendly_id/jackson/FriendlyIdDeserializer.java
import java.io.IOException;
import java.util.UUID;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.deser.std.UUIDDeserializer;
import com.devskiller.friendly_id.FriendlyId;

package com.devskiller.friendly_id.jackson;




public class FriendlyIdDeserializer extends UUIDDeserializer {

	@Override
	public UUID deserialize(JsonParser parser, DeserializationContext deserializationContext) throws IOException {

		JsonToken token = parser.getCurrentToken();
		if (token == JsonToken.VALUE_STRING) {
			String string = parser.getValueAsString().trim();
			if (looksLikeUuid(string)) {
				return super.deserialize(parser, deserializationContext);
			} else {
				return FriendlyId.toUuid(string);