示例#1
0
 @SuppressWarnings("unchecked")
 public static <Type extends DocumentNode> Type getOtherVersion(
     Type documentNode, Version version) {
   if (documentNode.getVersion() == version) {
     return documentNode;
   } else {
     for (DocumentNode otherVersion : documentNode.getOtherVersions()) {
       if (otherVersion.getVersion() == version) {
         return (Type) otherVersion;
       }
     }
     return null;
   }
 }
示例#2
0
 public static void setVersion(DocumentNode node, Version version) {
   node.setVersion(version);
 }