@Override
	public final <T> Comparable getComparableProperty(final PropertyKey<T> key) {

		if (key != null) {

			final T propertyValue = getProperty(key);

			// check property converter
			PropertyConverter<T, ?> converter = key.databaseConverter(securityContext, this);
			if (converter != null) {

				try {
					return converter.convertForSorting(propertyValue);

				} catch (Throwable t) {

					logger.warn("Unable to convert property {} of type {}: {}", new Object[]{
						key.dbName(),
						getClass().getSimpleName(),
						t.getMessage()
					});

					logger.warn("", t);
				}
			}

			// conversion failed, may the property value itself is comparable
			if (propertyValue instanceof Comparable) {
				return (Comparable) propertyValue;
			}

			// last try: convertFromInput to String to make comparable
			if (propertyValue != null) {
				return propertyValue.toString();
			}
		}

		return null;
	}
@ Override public final < T > Comparable getComparableProperty ( final PropertyKey < T > key ) { if ( key != null ) { final T propertyValue = getProperty ( key ) ; PropertyConverter < T , ? > converter = key . databaseConverter ( securityContext , this ) ; if ( converter != null ) { try { return converter . convertForSorting ( propertyValue ) ; } catch ( Throwable t ) { logger . warn ( "Unable to convert property {} of type {}: {}" , new Object [ ] { key . dbName ( ) , getClass ( ) . getSimpleName ( ) , t . getMessage ( ) } ) ; logger . warn ( "" , t ) ; } } if ( propertyValue instanceof Comparable ) { return ( Comparable ) propertyValue ; } if ( propertyValue != null ) { return propertyValue . toString ( ) ; } } return null ; }
Returns the property value for the given key as a Comparable

@param key the property key to retrieve the value for
@return the property value for the given key as a Comparable