public final class Features extends Static
Defined in the sis-feature
module
Modifier and Type | Method and Description |
---|---|
static <V> AbstractAttribute<V> |
cast(AbstractAttribute<?> attribute,
Class<V> valueClass)
Casts the given attribute instance to the given parameterized type.
|
static <V> DefaultAttributeType<V> |
cast(DefaultAttributeType<?> type,
Class<V> valueClass)
Casts the given attribute type to the given parameterized type.
|
static GenericName |
getValueTypeName(AbstractIdentifiedType property)
Returns the name of the type of values that the given property can take.
|
static void |
validate(AbstractFeature feature)
Ensures that all characteristics and property values in the given feature are valid.
|
public static <V> DefaultAttributeType<V> cast(DefaultAttributeType<?> type, Class<V> valueClass) throws ClassCastException
V
- the expected value class.type
- the attribute type to cast, or null
.valueClass
- the expected value class.null
if the given type was null.ClassCastException
- if the given attribute type does not have the expected value class.public static <V> AbstractAttribute<V> cast(AbstractAttribute<?> attribute, Class<V> valueClass) throws ClassCastException
V
- the expected value class.attribute
- the attribute instance to cast, or null
.valueClass
- the expected value class.null
if the given instance was null.ClassCastException
- if the given attribute instance does not have the expected value class.public static GenericName getValueTypeName(AbstractIdentifiedType property)
Class
, a FeatureType
or another PropertyType
depending on given argument:
property
is an AttributeType
, then this method gets the
value class and
maps that class to a name.property
is a FeatureAssociationRole
, then this method gets
the name of the value type.
This methods can work even if the associated FeatureType
is not yet resolved.property
is an Operation
, then this method returns the name of the
result type.property
- the property for which to get the name of value type.null
if none.public static void validate(AbstractFeature feature) throws IllegalArgumentException
This method gets a quality report as documented in the AbstractFeature.quality()
method
and verifies that all conformance tests pass. If at least one ConformanceResult.pass
attribute is false, then an
InvalidPropertyValueException
is thrown. Otherwise this method returns doing nothing.
feature
- the feature to validate, or null
.IllegalArgumentException
- if the given feature is non-null and does not pass validation.Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.