public class FeatureInputType extends Object
Modifier and Type | Method and Description |
---|---|
static Class<? extends FeatureInput> |
determineInputType(Class<? extends FeatureInput> inputType1,
Class<? extends FeatureInput> inputType2)
Finds a common input-type for two classes, throwing an exception if the two types aren't
compatible.
|
static <T extends FeatureInput> |
determineInputType(List<Feature<T>> list)
Finds a common input-type for classes in the list, throwing an exception if any two types
aren't compatible.
|
static boolean |
isCompatibleWith(Class<? extends FeatureInput> sourceType,
Class<? extends FeatureInput> otherType)
Can these parameters be used with a particular feature?
|
static Optional<Class<? extends FeatureInput>> |
prefer(Class<? extends FeatureInput> inputType1,
Class<? extends FeatureInput> inputType2)
Prefer to keep descriptor whose input-class is a sub-class rather than a super-class.
|
static Class<? extends FeatureInput> |
prefer(Feature<?> feature1,
Feature<?> feature2)
Like
prefer(Class, Class) but accepts features directly as input. |
public static boolean isCompatibleWith(Class<? extends FeatureInput> sourceType, Class<? extends FeatureInput> otherType)
sourceType
- type of input.otherType
- type of other.sourceType
can be used with an input of otherType
.public static Optional<Class<? extends FeatureInput>> prefer(Class<? extends FeatureInput> inputType1, Class<? extends FeatureInput> inputType2)
The order of the two inputType
parameters is irrelevant.
inputType1
- first input-type.inputType2
- second input-type.public static Class<? extends FeatureInput> prefer(Feature<?> feature1, Feature<?> feature2)
prefer(Class, Class)
but accepts features directly as input.
The order of the two inputType
parameters is irrelevant.
feature1
- first-feature.feature2
- second-feature.public static Class<? extends FeatureInput> determineInputType(Class<? extends FeatureInput> inputType1, Class<? extends FeatureInput> inputType2)
inputType1
- first input-type.inputType2
- second input-type.AnchorFriendlyRuntimeException
- if they aren't compatible types.public static <T extends FeatureInput> Class<? extends FeatureInput> determineInputType(List<Feature<T>> list)
T
- common parent input-type on the list (all elements in the list must have a
input-type that sub-classes this).list
- list of features to determine a common input-type for.AnchorFriendlyRuntimeException
- if they are any two incompatible types.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.