Package org.yamcs.xtceproc
Class ParameterTypeUtils
- java.lang.Object
-
- org.yamcs.xtceproc.ParameterTypeUtils
-
public class ParameterTypeUtils extends Object
Contains various static methods to help work with XTCEParameterType
-
-
Constructor Summary
Constructors Constructor Description ParameterTypeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
checkEngValueAssignment(Parameter p, Value engValue)
Checks that a value can be assigned to a parameter as enginnering value Throws an IllegalArgumentException if notstatic void
checkEngValueAssignment(ParameterType ptype, Value engValue)
static org.yamcs.protobuf.Yamcs.Value.Type
getEngType(ParameterType ptype)
Returns the nominal Value.Type of a parameter of the given XTCE parameter type definitionstatic Value
getEngValue(ParameterType ptype, Object value)
Returns a Value corresponding to the java object and the parameter type or null if the parameter cannot be converted Note that the operation may involve some casting and loss of precision (e.g. from long to int or double to float)static Value
parseString(ParameterType type, String paramValue)
-
-
-
Method Detail
-
checkEngValueAssignment
public static void checkEngValueAssignment(Parameter p, Value engValue)
Checks that a value can be assigned to a parameter as enginnering value Throws an IllegalArgumentException if not- Parameters:
p
-engValue
-
-
checkEngValueAssignment
public static void checkEngValueAssignment(ParameterType ptype, Value engValue)
-
parseString
public static Value parseString(ParameterType type, String paramValue)
-
getEngType
public static org.yamcs.protobuf.Yamcs.Value.Type getEngType(ParameterType ptype)
Returns the nominal Value.Type of a parameter of the given XTCE parameter type definition- Parameters:
ptype
- - the parameter type- Returns:
-
getEngValue
public static Value getEngValue(ParameterType ptype, Object value)
Returns a Value corresponding to the java object and the parameter type or null if the parameter cannot be converted Note that the operation may involve some casting and loss of precision (e.g. from long to int or double to float)- Parameters:
ptype
-value
-- Returns:
-
-