Code example for TypeDescriptor

Methods: getType

0
	 * (non-Javadoc) 
	 * @see org.springframework.core.convert.converter.ConditionalConverter#matches(org.springframework.core.convert.TypeDescriptor, org.springframework.core.convert.TypeDescriptor) 
	 */ 
	@Override 
	public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
		if (String.class.isAssignableFrom(sourceType.getType())) {
			return UUID.class.isAssignableFrom(targetType.getType());
		} 
 
		return UUID.class.isAssignableFrom(sourceType.getType()) && String.class.isAssignableFrom(targetType.getType());
	} 
 
	/* 
	 * (non-Javadoc) 
	 * @see org.springframework.core.convert.converter.GenericConverter#getConvertibleTypes() 
	 */ 
	@Override 
	public Set<ConvertiblePair> getConvertibleTypes() {
		return CONVERTIBLE_PAIRS;
	}