public PortletPreferenceImpl(PortletPreferenceImpl portletPreference) {
    if (portletPreference.getName() == null) {
      throw new IllegalArgumentException("name cannot be null");
    }

    this.portletPreferenceId = -1;
    this.entityVersion = -1;
    this.name = portletPreference.getName();
    this.readOnly = portletPreference.isReadOnly();
    this.setValues(portletPreference.getValues());
  }
 /** @see java.lang.Object#equals(Object) */
 @Override
 public boolean equals(Object object) {
   if (object == this) {
     return true;
   }
   if (!(object instanceof IPortletPreference)) {
     return false;
   }
   PortletPreferenceImpl rhs = (PortletPreferenceImpl) object;
   return new EqualsBuilder()
       .append(this.name, rhs.getName())
       .append(this.readOnly, rhs.isReadOnly())
       .append(this.getValues(), rhs.getValues())
       .isEquals();
 }