Package org.yamcs.utils
Class StringConverter
- java.lang.Object
-
- org.yamcs.utils.StringConverter
-
public class StringConverter extends Object
-
-
Constructor Summary
Constructors Constructor Description StringConverter()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static String
arrayToHexString(byte[] b)
static String
arrayToHexString(byte[] b, boolean beautify)
static String
arrayToHexString(byte[] b, int offset, int length)
static String
arrayToHexString(byte[] b, int offset, int length, boolean beautify)
static String
byteBufferToHexString(ByteBuffer bb)
static byte[]
hexStringToArray(String s)
Convert a hex string into a byte array.static String
idListToString(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList)
Convert a list of NamedObjectId to a pretty string for use in log messages etc.static String
idToString(org.yamcs.protobuf.Yamcs.NamedObjectId id)
Convert a NamedObjectId to a pretty string for use in log messages etc.static String
toString(org.yamcs.protobuf.Commanding.CommandId cmdId)
static String
toString(org.yamcs.protobuf.Yamcs.Value rv)
static String
toString(org.yamcs.protobuf.Yamcs.Value rv, boolean withType)
Deprecated.
-
-
-
Method Detail
-
toString
public static String toString(org.yamcs.protobuf.Yamcs.Value rv)
-
toString
@Deprecated public static String toString(org.yamcs.protobuf.Yamcs.Value rv, boolean withType)
Deprecated.UseObject.toString()
instead.
-
arrayToHexString
public static String arrayToHexString(byte[] b, int offset, int length)
-
arrayToHexString
public static String arrayToHexString(byte[] b, int offset, int length, boolean beautify)
-
arrayToHexString
public static String arrayToHexString(byte[] b)
-
arrayToHexString
public static String arrayToHexString(byte[] b, boolean beautify)
-
byteBufferToHexString
public static String byteBufferToHexString(ByteBuffer bb)
-
hexStringToArray
public static byte[] hexStringToArray(String s)
Convert a hex string into a byte array. If the string has an odd number of hex digits, it is padded with 0 at the beginning.- Parameters:
s
- - string to be converted- Returns:
- binary array representation of the hex string
-
idToString
public static String idToString(org.yamcs.protobuf.Yamcs.NamedObjectId id)
Convert a NamedObjectId to a pretty string for use in log messages etc. This gives a better formatting than the default protobuf-generated toString.
-
idListToString
public static String idListToString(List<org.yamcs.protobuf.Yamcs.NamedObjectId> idList)
Convert a list of NamedObjectId to a pretty string for use in log messages etc. This gives a better formatting than the default protobuf-generated toString.
-
toString
public static String toString(org.yamcs.protobuf.Commanding.CommandId cmdId)
-
-