Exemplo n.º 1
0
 private boolean hasChild(AdvancedCache<?, ?> cache, Fqn f) {
   if (f.size() > 1) {
     // indirect child.
     Fqn absoluteFqn = Fqn.fromRelativeFqn(fqn, f);
     return exists(cache, absoluteFqn);
   } else {
     return hasChild(f.getLastElement());
   }
 }
 @Override
 public boolean hasChild(Fqn f) {
   if (f.size() > 1) {
     // indirect child.
     Fqn absoluteFqn = Fqn.fromRelativeFqn(fqn, f);
     return exists(absoluteFqn);
   } else {
     return hasChild(f.getLastElement());
   }
 }
Exemplo n.º 3
0
 /**
  * Creates a new Fqn whose ancestor has been replaced with the new ancestor passed in.
  *
  * @param oldAncestor old ancestor to replace
  * @param newAncestor nw ancestor to replace with
  * @return a new Fqn with ancestors replaced.
  */
 public Fqn replaceAncestor(Fqn oldAncestor, Fqn newAncestor) {
   if (!isChildOf(oldAncestor))
     throw new IllegalArgumentException("Old ancestor must be an ancestor of the current Fqn!");
   Fqn subFqn = this.getSubFqn(oldAncestor.size(), size());
   return Fqn.fromRelativeFqn(newAncestor, subFqn);
 }