public final class Parameters extends Static
Defined in the sis-referencing
module
Modifier and Type | Method and Description |
---|---|
static <T> ParameterDescriptor<T> |
cast(ParameterDescriptor<?> descriptor,
Class<T> valueClass)
Casts the given parameter descriptor to the given type.
|
static <T> ParameterValue<T> |
cast(ParameterValue<?> value,
Class<T> type)
Casts the given parameter value to the given type.
|
static void |
copy(ParameterValueGroup values,
ParameterValueGroup destination)
Copies the values of a parameter group into another parameter group.
|
static MemberName |
getMemberName(ParameterDescriptor<?> parameter)
Gets the parameter name as an instance of
MemberName . |
static Range<?> |
getValueDomain(ParameterDescriptor<?> descriptor)
Returns the domain of valid values defined by the given descriptor, or
null if none. |
public static MemberName getMemberName(ParameterDescriptor<?> parameter)
MemberName
.
This method performs the following checks:
MemberName
,
returns that primary name.MemberName
. If found, that alias is returned.DefaultTypeName
javadoc.CC_OperationParameter
) and the one
defined by ISO 19115 (namely SV_Parameter
).parameter
- The parameter from which to get the name (may be null
).null
if none.Names.createMemberName(CharSequence, String, CharSequence, Class)
public static Range<?> getValueDomain(ParameterDescriptor<?> descriptor)
null
if none.
This method builds the range from the minimum value,
maximum value and, if the values are numeric, from
the unit.descriptor
- The parameter descriptor, or null
.null
if none.DefaultParameterDescriptor.getValueDomain()
public static <T> ParameterDescriptor<T> cast(ParameterDescriptor<?> descriptor, Class<T> valueClass) throws ClassCastException
T
- The expected value class.descriptor
- The descriptor to cast, or null
.valueClass
- The expected value class.null
if the given descriptor was null.ClassCastException
- if the given descriptor does not have the expected value class.public static <T> ParameterValue<T> cast(ParameterValue<?> value, Class<T> type) throws ClassCastException
T
- The expected value class.value
- The value to cast, or null
.type
- The expected value class.null
if the given value was null.ClassCastException
- if the given value doesn't have the expected value class.public static void copy(ParameterValueGroup values, ParameterValueGroup destination) throws InvalidParameterNameException, InvalidParameterValueException
source
group shall be valid for the destination
group,
but the destination
may have more parameters.
Sub-groups are copied recursively.
A typical usage of this method is for transferring values from an arbitrary implementation to some specific implementation, or to a parameter group using a different but compatible descriptor.
values
- The parameters values to copy.destination
- Where to copy the values.InvalidParameterNameException
- if a source
parameter name is unknown to the destination
.InvalidParameterValueException
- if the value of a source
parameter is invalid for the destination
.Copyright © 2010–2015 The Apache Software Foundation. All rights reserved.