Java源码示例:org.apache.flink.api.java.typeutils.runtime.GenericTypeComparator

示例1
@SuppressWarnings("unchecked")
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if (isKeyType()) {
		@SuppressWarnings("rawtypes")
		GenericTypeComparator comparator = new GenericTypeComparator(sortOrderAscending, createSerializer(executionConfig), this.typeClass);
		return (TypeComparator<T>) comparator;
	}

	throw new UnsupportedOperationException("Types that do not implement java.lang.Comparable cannot be used as keys.");
}
 
示例2
@SuppressWarnings("unchecked")
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if (isKeyType()) {
		@SuppressWarnings("rawtypes")
		GenericTypeComparator comparator = new GenericTypeComparator(sortOrderAscending, createSerializer(executionConfig), this.typeClass);
		return (TypeComparator<T>) comparator;
	}

	throw new UnsupportedOperationException("Types that do not implement java.lang.Comparable cannot be used as keys.");
}
 
示例3
@SuppressWarnings("unchecked")
@Override
@PublicEvolving
public TypeComparator<T> createComparator(boolean sortOrderAscending, ExecutionConfig executionConfig) {
	if (isKeyType()) {
		@SuppressWarnings("rawtypes")
		GenericTypeComparator comparator = new GenericTypeComparator(sortOrderAscending, createSerializer(executionConfig), this.typeClass);
		return (TypeComparator<T>) comparator;
	}

	throw new UnsupportedOperationException("Types that do not implement java.lang.Comparable cannot be used as keys.");
}