private UUID _badFormat(String uuidStr, DeserializationContext ctxt) throws IOException { return (UUID) ctxt.handleWeirdStringValue(handledType(), uuidStr, "UUID has to be represented by standard 36-char representation"); }
int _badChar(String uuidStr, int index, DeserializationContext ctxt, char c) throws JsonMappingException { // 15-May-2016, tatu: Ideally should not throw, but call `handleWeirdStringValue`... // however, control flow is gnarly here, so for now just throw throw ctxt.weirdStringException(uuidStr, handledType(), String.format( "Non-hex character '%c' (value 0x%s), not valid for UUID String", c, Integer.toHexString(c))); }
private UUID _fromBytes(byte[] bytes, DeserializationContext ctxt) throws JsonMappingException { if (bytes.length != 16) { throw InvalidFormatException.from(ctxt.getParser(), "Can only construct UUIDs from byte[16]; got "+bytes.length+" bytes", bytes, handledType()); } return new UUID(_long(bytes, 0), _long(bytes, 8)); }
private UUID _badFormat(String uuidStr, DeserializationContext ctxt) throws IOException { return (UUID) ctxt.handleWeirdStringValue(handledType(), uuidStr, "UUID has to be represented by standard 36-char representation"); }
int _badChar(String uuidStr, int index, DeserializationContext ctxt, char c) throws JsonMappingException { // 15-May-2016, tatu: Ideally should not throw, but call `handleWeirdStringValue`... // however, control flow is gnarly here, so for now just throw throw ctxt.weirdStringException(uuidStr, handledType(), String.format( "Non-hex character '%c' (value 0x%s), not valid for UUID String", c, Integer.toHexString(c))); }
private UUID _badFormat(String uuidStr, DeserializationContext ctxt) throws IOException { return (UUID) ctxt.handleWeirdStringValue(handledType(), uuidStr, "UUID has to be represented by standard 36-char representation"); }
int _badChar(String uuidStr, int index, DeserializationContext ctxt, char c) throws JsonMappingException { // 15-May-2016, tatu: Ideally should not throw, but call `handleWeirdStringValue`... // however, control flow is gnarly here, so for now just throw throw ctxt.weirdStringException(uuidStr, handledType(), String.format( "Non-hex character '%c' (value 0x%s), not valid for UUID String", c, Integer.toHexString(c))); }
private UUID _fromBytes(byte[] bytes, DeserializationContext ctxt) throws JsonMappingException { if (bytes.length != 16) { throw InvalidFormatException.from(ctxt.getParser(), "Can only construct UUIDs from byte[16]; got "+bytes.length+" bytes", bytes, handledType()); } return new UUID(_long(bytes, 0), _long(bytes, 8)); }
private UUID _fromBytes(byte[] bytes, DeserializationContext ctxt) throws JsonMappingException { if (bytes.length != 16) { throw InvalidFormatException.from(ctxt.getParser(), "Can only construct UUIDs from byte[16]; got "+bytes.length+" bytes", bytes, handledType()); } return new UUID(_long(bytes, 0), _long(bytes, 8)); }