Coverage Report - org.homeunix.thecave.buddi.plugin.api.model.impl.ImmutableModelObjectImpl
 
Classes in this File Line Coverage Branch Coverage Complexity
ImmutableModelObjectImpl
0%
0/15
0%
0/4
1.5
 
 1  
 /*
 2  
  * Created on Aug 12, 2007 by wyatt
 3  
  */
 4  
 package org.homeunix.thecave.buddi.plugin.api.model.impl;
 5  
 
 6  
 import java.util.Date;
 7  
 
 8  
 import org.homeunix.thecave.buddi.model.ModelObject;
 9  
 import org.homeunix.thecave.buddi.plugin.api.model.ImmutableModelObject;
 10  
 
 11  0
 public abstract class ImmutableModelObjectImpl implements ImmutableModelObject {
 12  
         private ModelObject raw;
 13  
         
 14  0
         public ImmutableModelObjectImpl(ModelObject raw) {
 15  0
                 this.raw = raw;
 16  0
         }
 17  
         
 18  
         public ModelObject getRaw(){
 19  0
                 return raw;
 20  
         }
 21  
         
 22  
         public int compareTo(ImmutableModelObject o) {
 23  0
                 return this.getRaw().compareTo(o.getRaw());
 24  
         }
 25  
         
 26  
         @Override
 27  
         public boolean equals(Object obj) {
 28  0
                 if (obj instanceof ImmutableModelObject)
 29  0
                         return getRaw().equals(((ImmutableModelObject) obj).getRaw());
 30  0
                 return false;
 31  
         }
 32  
         
 33  
         @Override
 34  
         public int hashCode() {
 35  0
                 return getRaw().hashCode();
 36  
         }
 37  
         
 38  
         /**
 39  
          * Returns the UID string for this object.
 40  
          * @return
 41  
          */
 42  
         public String getUid(){
 43  0
                 return getRaw().getUid();
 44  
         }
 45  
         
 46  
         public Date getModified() {
 47  0
                 return getRaw().getModified();
 48  
         }
 49  
         
 50  
         @Override
 51  
         public String toString() {
 52  0
                 if (getRaw() != null)
 53  0
                         return getRaw().toString();
 54  0
                 return "null";
 55  
         }
 56  
 }