APIdia Launch Partner
Top Description Inners Methods
jdk.dynalink.linker

public Interface ConversionComparator


Optional interface to be implemented by GuardingTypeConverterFactory implementers. Language-specific conversions can cause increased overloaded method resolution ambiguity, as many methods can become applicable because of additional conversions. The static way of selecting the "most specific" method will fail more often, because there will be multiple maximally specific method with unrelated signatures. In these cases, language runtimes can be asked to resolve the ambiguity by expressing preferences for one conversion over the other.
Since
9

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
ConversionComparator.Comparison

Enumeration of possible outcomes of comparing one conversion to another.

Method Summary

Modifier and TypeMethod and Description
public ConversionComparator.Comparison

Returns:

one of Comparison constants that establish which - if any - of the target types is preferred for the conversion.
compareConversion
(Class<?>
the source type.
sourceType
,
Class<?>
one potential target type
targetType1
,
Class<?>
another potential target type.
targetType2
)

Determines which of the two target types is the preferred conversion target from a source type.

Method Detail

compareConversionback to summary
public ConversionComparator.Comparison compareConversion(Class<?> sourceType, Class<?> targetType1, Class<?> targetType2)

Determines which of the two target types is the preferred conversion target from a source type.

Parameters
sourceType:Class<?>

the source type.

targetType1:Class<?>

one potential target type

targetType2:Class<?>

another potential target type.

Returns:ConversionComparator.Comparison

one of Comparison constants that establish which - if any - of the target types is preferred for the conversion.

jdk.dynalink.linker back to summary

public final Enum ConversionComparator.Comparison

extends Enum<ConversionComparator.Comparison>
Class Inheritance

Enumeration of possible outcomes of comparing one conversion to another.
Since
9

Field Summary

Modifier and TypeField and Description
public static final ConversionComparator.Comparison
INDETERMINATE

The conversions cannot be compared.

public static final ConversionComparator.Comparison
TYPE_1_BETTER

The first conversion is better than the second one.

public static final ConversionComparator.Comparison
TYPE_2_BETTER

The second conversion is better than the first one.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static ConversionComparator.Comparison
public static ConversionComparator.Comparison[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

INDETERMINATEback to summary
public static final ConversionComparator.Comparison INDETERMINATE

The conversions cannot be compared.

TYPE_1_BETTERback to summary
public static final ConversionComparator.Comparison TYPE_1_BETTER

The first conversion is better than the second one.

TYPE_2_BETTERback to summary
public static final ConversionComparator.Comparison TYPE_2_BETTER

The second conversion is better than the first one.

Constructor Detail

Comparisonback to summary
private Comparison()

Method Detail

valueOfback to summary
public static ConversionComparator.Comparison valueOf(String name)
valuesback to summary
public static ConversionComparator.Comparison[] values()