Package org.yamcs.utils
Class ValueUtility
- java.lang.Object
-
- org.yamcs.utils.ValueUtility
-
public class ValueUtility extends Object
-
-
Constructor Summary
Constructors Constructor Description ValueUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcompare(Value a, Value b)static booleanequals(Value a, Value b)static ValuefromGpb(org.yamcs.protobuf.Yamcs.Value v)static ValuegetBinaryValue(byte[] x)static ValuegetBooleanValue(boolean b)static ValuegetColumnValue(ColumnDefinition cd, Object v)static org.yamcs.protobuf.Yamcs.ValuegetDoubleGbpValue(double d)static ValuegetDoubleValue(double d)static ValuegetEnumeratedValue(long longValue, String stringValue)static ValuegetFloatValue(float f)static ValuegetSint32Value(int x)static ValuegetSint64Value(long x)static org.yamcs.protobuf.Yamcs.ValuegetStringGbpValue(String s)static ValuegetStringValue(String x)static ValuegetTimestampValue(long x)static org.yamcs.protobuf.Yamcs.ValuegetUint32GbpValue(int x)static ValuegetUint32Value(int x)static ValuegetUint64Value(long x)static DataTypegetYarchType(org.yamcs.protobuf.Yamcs.Value.Type type)static ObjectgetYarchValue(Value v)static ObjectgetYarchValue(org.yamcs.protobuf.Yamcs.Value v)static booleanprocessAsDouble(Value v, DoubleConsumer c)if the passed on value is float, double or integer invoke the function on the double value and return true if v is of other types return falsestatic booleanprocessAsDouble1(Value v, DoubleConsumer c)if the passed on value is FLOAT or DOUBLE, invoke the function on the double value and return true if v is of other types return falsestatic booleanprocessAsLong(Value v, LongConsumer c)if the passed on value is INT32, SINT32, INT64 or SINT64, invoke the function on the long value and return true if v is of other types return falsestatic org.yamcs.protobuf.Yamcs.AggregateValuetoGbp(AggregateValue v)static org.yamcs.protobuf.Yamcs.ValuetoGbp(Value v)
-
-
-
Method Detail
-
getUint32Value
public static Value getUint32Value(int x)
-
getSint32Value
public static Value getSint32Value(int x)
-
getUint64Value
public static Value getUint64Value(long x)
-
getSint64Value
public static Value getSint64Value(long x)
-
getBinaryValue
public static Value getBinaryValue(byte[] x)
-
getTimestampValue
public static Value getTimestampValue(long x)
-
getBooleanValue
public static Value getBooleanValue(boolean b)
-
getFloatValue
public static Value getFloatValue(float f)
-
getDoubleValue
public static Value getDoubleValue(double d)
-
getDoubleGbpValue
public static org.yamcs.protobuf.Yamcs.Value getDoubleGbpValue(double d)
-
getStringGbpValue
public static org.yamcs.protobuf.Yamcs.Value getStringGbpValue(String s)
-
getUint32GbpValue
public static org.yamcs.protobuf.Yamcs.Value getUint32GbpValue(int x)
-
getColumnValue
public static Value getColumnValue(ColumnDefinition cd, Object v)
-
getYarchValue
public static Object getYarchValue(org.yamcs.protobuf.Yamcs.Value v)
-
getYarchType
public static DataType getYarchType(org.yamcs.protobuf.Yamcs.Value.Type type)
-
toGbp
public static org.yamcs.protobuf.Yamcs.Value toGbp(Value v)
-
toGbp
public static org.yamcs.protobuf.Yamcs.AggregateValue toGbp(AggregateValue v)
-
fromGpb
public static Value fromGpb(org.yamcs.protobuf.Yamcs.Value v)
-
processAsLong
public static boolean processAsLong(Value v, LongConsumer c)
if the passed on value is INT32, SINT32, INT64 or SINT64, invoke the function on the long value and return true if v is of other types return false- Parameters:
v-c-- Returns:
-
processAsDouble
public static boolean processAsDouble(Value v, DoubleConsumer c)
if the passed on value is float, double or integer invoke the function on the double value and return true if v is of other types return false- Parameters:
v-c-- Returns:
-
processAsDouble1
public static boolean processAsDouble1(Value v, DoubleConsumer c)
if the passed on value is FLOAT or DOUBLE, invoke the function on the double value and return true if v is of other types return false- Parameters:
v-c-- Returns:
-
-