public T convert(SimpleObject propertiesToCreate) { DelegatingResourceHandler<? extends T> handler; if (hasTypesDefined()) { String type = (String) propertiesToCreate.remove(RestConstants.PROPERTY_FOR_TYPE); if (type == null) throw new IllegalArgumentException( "When creating a resource that supports subclasses, you must indicate the particular subclass with a " + RestConstants.PROPERTY_FOR_TYPE + " property"); handler = getResourceHandler(type); } else { handler = this; } T delegate = handler.newDelegate(propertiesToCreate); DelegatingResourceDescription description = handler.getCreatableProperties(); if (propertiesToCreate.containsKey("uuid")) { description.addProperty("uuid"); } setConvertedProperties(delegate, propertiesToCreate, description, true); return delegate; }