com.jd.blockchain.ledger.TransactionPrivilegeBitset Maven / Gradle / Ivy
package com.jd.blockchain.ledger;
import java.util.ArrayList;
import java.util.List;
import utils.StringUtils;
public class TransactionPrivilegeBitset extends PrivilegeBitset implements TransactionPrivilege {
public TransactionPrivilegeBitset() {
}
public TransactionPrivilegeBitset(byte[] codeBytes) {
super(codeBytes);
}
@Override
public TransactionPrivilegeBitset clone() {
return (TransactionPrivilegeBitset) super.clone();
}
public List getPrivilege(){
List permissionList = new ArrayList<>();
String permissionStr = super.cloneBitSet().get(8,Integer.MAX_VALUE).toString();
if(!StringUtils.isEmpty(permissionStr)){
for (TransactionPermission transactionPermission : TransactionPermission.values()){
if(super.cloneBitSet().get(8,Integer.MAX_VALUE).get(transactionPermission.CODE)){
permissionList.add(transactionPermission);
}
}
}
return permissionList;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy