@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
return (T) ob; return _deserializeEmbedded(ob, ctxt);
@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
return (T) ob; return _deserializeEmbedded(ob, ctxt);
@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
@Override protected UUID _deserializeEmbedded(Object ob, DeserializationContext ctxt) throws IOException, JsonProcessingException { if (ob instanceof byte[]) { byte[] bytes = (byte[]) ob; if (bytes.length != 16) { ctxt.mappingException("Can only construct UUIDs from 16 byte arrays; got "+bytes.length+" bytes"); } // clumsy, but should work for now... DataInputStream in = new DataInputStream(new ByteArrayInputStream(bytes)); long l1 = in.readLong(); long l2 = in.readLong(); return new UUID(l1, l2); } super._deserializeEmbedded(ob, ctxt); return null; // never gets here } }
return (T) ob; return _deserializeEmbedded(ob, ctxt);
return (T) ob; return _deserializeEmbedded(ob, ctxt);