Clover coverage report -
Coverage timestamp: Thu Jul 5 2007 20:02:32 EDT
file stats: LOC: 82   Methods: 7
NCLOC: 42   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
GravitateResult.java - 88.9% 85.7% 87.5%
coverage coverage
 1    package org.jboss.cache.buddyreplication;
 2   
 3    import org.jboss.cache.Fqn;
 4    import org.jboss.cache.marshall.NodeData;
 5   
 6    import java.util.List;
 7   
 8    /**
 9    * A class that encapsulates the result of a data gravitation call, a part of the Buddy Replication framwork. A GravitateResult
 10    * contains 3 elements; a boolean indicating whether the gravitation request found any data at all, a List of {@link NodeData} objects
 11    * containing the data to be gravitated, and an {@link Fqn} of the buddy backup region being gravitated.
 12    *
 13    * @since 2.0.0
 14    */
 15    public class GravitateResult
 16    {
 17    private boolean dataFound;
 18   
 19    private List<NodeData> nodeData;
 20   
 21    private Fqn buddyBackupFqn;
 22   
 23    /**
 24    * Factory method that creates a GravitateResult indicating that no data has been found.
 25    *
 26    * @return GravitateResult encapsulating the fact that no data was found
 27    */
 28  67 public static GravitateResult noDataFound()
 29    {
 30  67 return new GravitateResult(false, null, null);
 31    }
 32   
 33    /**
 34    * Factory method that creates a GravitateResult with the data found and the backup fqn it was found in.
 35    *
 36    * @param nodeData data found
 37    * @param fqn backup fqn the data was found in
 38    * @return GravitateResult encapsulating the above
 39    */
 40  88 public static GravitateResult subtreeResult(List<NodeData> nodeData, Fqn fqn)
 41    {
 42  88 return new GravitateResult(true, nodeData, fqn);
 43    }
 44   
 45  155 private GravitateResult(boolean dataFound, List<NodeData> nodeData, Fqn buddyBackupRegion)
 46    {
 47  155 this.dataFound = dataFound;
 48  155 this.nodeData = nodeData;
 49  155 this.buddyBackupFqn = buddyBackupRegion;
 50    }
 51   
 52    /**
 53    * @return the buddyBackupFqn
 54    */
 55  85 public Fqn getBuddyBackupFqn()
 56    {
 57  85 return buddyBackupFqn;
 58    }
 59   
 60    /**
 61    * @return true if data was found
 62    */
 63  190 public boolean isDataFound()
 64    {
 65  190 return dataFound;
 66    }
 67   
 68    /**
 69    * @return the nodeData
 70    */
 71  72 public List<NodeData> getNodeData()
 72    {
 73  72 return nodeData;
 74    }
 75   
 76  0 public String toString()
 77    {
 78  0 return "Result dataFound=" + dataFound +
 79    " nodeData=" + nodeData +
 80    " fqn=" + buddyBackupFqn;
 81    }
 82    }