1 18 19 package org.apache.roller.pojos; 20 21 import java.io.Serializable ; 22 import org.apache.commons.lang.builder.EqualsBuilder; 23 import org.apache.commons.lang.builder.ToStringBuilder; 24 import org.apache.commons.lang.builder.ToStringStyle; 25 import org.apache.roller.RollerException; 26 27 28 31 public abstract class PersistentObject implements Serializable { 32 33 34 37 public abstract String getId(); 38 39 40 public abstract void setId( String id ); 41 42 43 46 public abstract void setData(PersistentObject obj); 47 48 49 public boolean equals(Object o) { 50 return EqualsBuilder.reflectionEquals(this, o); 51 } 52 53 54 public String toString() { 56 try { 57 return ToStringBuilder.reflectionToString( 59 this, ToStringStyle.MULTI_LINE_STYLE); 60 } catch (Throwable e) { 61 return getClass().getName() + ":" + getId(); 63 } 64 } 65 66 } 67 68 | Popular Tags |