writing component: IdentifierWrapper

This commit is contained in:
free will committed 2021-03-11 22:18:22 +08:00
1 parent eee0c0304a
commit 8aad00bbf4
1 file changed
+54
@@ -0,0 +1,54 @@
package component;
import encoding.*;
/*
* @Author: Wang Feng
* @Description:
* @Version: 1.0.0
* @Date: 10:48 2021/3/11
* @Copyright: MIN-Group;国家重大科技基础设施——未来网络北大实验室;深圳市信息论与未来网络重点实验室
*/
public class IdentifierWrapper implements TlvComponentBase, IEncodingAble {
private Identifier identifier;
private VlInt tlvType;
/**
* 从一个 IdentifierWrapper 编码成的 TLV Block 中解析出一个 IdentifierWrapper
*/
public IdentifierWrapper(Block block){
if(!block.parseSubElements()){
// todo: 错误处理
}
// 检查是否包含有且仅有一个 Identifier TLV
if((block.getSubElements().length()!=1)&&block.getSubElements().getBlock(0).getType().isEqual(TLV.TlvIdentifier)){
// todo: 错误处理
}
}
/**
* 自定义标识类型,根据标识的字符串标识创建一个自定义的标识
* @param tlvType
* @param identifierString
* @return
*/
public IdentifierWrapper createCustomIdentifierByString(VlInt tlvType,String identifierString){
}
public IdentifierWrapper createCustomIdentifierByComponents(){
}
@Override
public int wireEncode(Encoder encoder) {
return 0;
}
@Override
public boolean wireDecode(Block block) {
return false;
}
}