Package org.xipki.apppackage.cbor
Class CborType
- java.lang.Object
-
- org.xipki.apppackage.cbor.CborType
-
public class CborType extends Object
Represents the various major types in CBOR, along with their .The major type is encoded in the upper three bits of each initial byte. The lower 5 bytes represent any additional information.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)intgetAdditionalInfo()intgetMajorType()static StringgetName(int mt)Returns a descriptive string for the given major type.inthashCode()StringtoString()static CborTypevalueOf(int i)Decodes a given byte value to aCborTypevalue.
-
-
-
Method Detail
-
getName
public static String getName(int mt)
Returns a descriptive string for the given major type.- Parameters:
mt- the major type to return as string, values from [0..7] are supported.- Returns:
- the name of the given major type, as String, never
null. - Throws:
IllegalArgumentException- in case the given major type is not supported.
-
getAdditionalInfo
public int getAdditionalInfo()
- Returns:
- the additional information of this type, as integer value from [0..31].
-
getMajorType
public int getMajorType()
- Returns:
- the major type, as integer value from [0..7].
-
-