create instance parent getter

This commit is contained in:
REAndroid 2023-02-18 11:27:33 -05:00
parent a40b086f9e
commit 9c17fbbdb7

View File

@ -100,6 +100,16 @@ public abstract class Block {
}
return null;
}
public final <T> T getParentInstance(Class<T> parentClass){
Block parent = getParent();
while (parent!=null){
if(parentClass.isInstance(parent)){
return (T) parent;
}
parent = parent.getParent();
}
return null;
}
protected static byte[] addBytes(byte[] bts1, byte[] bts2){