CCM NG: All entity class of ccm-core pass tests for equals, hashCode and toString mehthods
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3455 8810af33-2d31-482b-a856-94f89814c4dfpull/2/head
parent
ce7f0a7e7b
commit
a79c67974d
|
|
@ -158,7 +158,7 @@ public class Categorization implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Categorization)) {
|
||||
return false;
|
||||
}
|
||||
final Categorization other = (Categorization) obj;
|
||||
|
|
|
|||
|
|
@ -308,7 +308,7 @@ public class Category extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Category)) {
|
||||
return false;
|
||||
}
|
||||
final Category other = (Category) obj;
|
||||
|
|
@ -360,11 +360,11 @@ public class Category extends CcmObject implements Serializable {
|
|||
+ "categoryOrder = %d%s",
|
||||
uniqueId,
|
||||
name,
|
||||
title.toString(),
|
||||
Objects.toString(title),
|
||||
enabled,
|
||||
visible,
|
||||
abstractCategory,
|
||||
parentCategory,
|
||||
Objects.toString(parentCategory),
|
||||
categoryOrder,
|
||||
data));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,12 +192,20 @@ public class Domain extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public Date getReleased() {
|
||||
if (released == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(released.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setReleased(final Date released) {
|
||||
if (released == null) {
|
||||
this.released = null;
|
||||
} else {
|
||||
this.released = new Date(released.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public Category getRoot() {
|
||||
return root;
|
||||
|
|
@ -213,6 +221,7 @@ public class Domain extends CcmObject implements Serializable {
|
|||
* {@link DomainManager}.
|
||||
*
|
||||
* @return An <strong>unmodifiable</strong> list of the owners of this {
|
||||
*
|
||||
* @Domain}
|
||||
*
|
||||
* @see #owners
|
||||
|
|
@ -254,7 +263,7 @@ public class Domain extends CcmObject implements Serializable {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 3;
|
||||
int hash = super.hashCode();
|
||||
hash = 41 * hash + Objects.hashCode(domainKey);
|
||||
hash = 41 * hash + Objects.hashCode(uri);
|
||||
hash = 41 * hash + Objects.hashCode(title);
|
||||
|
|
@ -271,10 +280,14 @@ public class Domain extends CcmObject implements Serializable {
|
|||
"PMD.StdCyclomaticComplexity",
|
||||
"PMD.ModifiedCyclomaticComplexity"})
|
||||
public boolean equals(final Object obj) {
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Domain)) {
|
||||
return false;
|
||||
}
|
||||
final Domain other = (Domain) obj;
|
||||
|
|
@ -318,11 +331,11 @@ public class Domain extends CcmObject implements Serializable {
|
|||
+ "released = %tF %<tT, "
|
||||
+ "root = \"%s\"%s",
|
||||
domainKey,
|
||||
uri.toString(),
|
||||
title.toString(),
|
||||
Objects.toString(uri),
|
||||
Objects.toString(title),
|
||||
version,
|
||||
released,
|
||||
root.toString(),
|
||||
Objects.toString(root),
|
||||
data
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ public class DomainOwnership implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof DomainOwnership)) {
|
||||
return false;
|
||||
}
|
||||
final DomainOwnership other = (DomainOwnership) obj;
|
||||
|
|
@ -199,8 +199,8 @@ public class DomainOwnership implements Serializable {
|
|||
+ "%s }",
|
||||
super.toString(),
|
||||
ownershipId,
|
||||
owner.toString(),
|
||||
domain.toString(),
|
||||
Objects.toString(owner),
|
||||
Objects.toString(domain),
|
||||
context,
|
||||
domainOrder,
|
||||
ownerOrder,
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ public class Resource extends CcmObject implements Serializable {
|
|||
// }
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
int hash = super.hashCode();
|
||||
hash = 29 * hash + Objects.hashCode(title);
|
||||
hash = 29 * hash + Objects.hashCode(description);
|
||||
hash = 29 * hash + Objects.hashCode(created);
|
||||
|
|
@ -176,11 +176,15 @@ public class Resource extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof Resource)) {
|
||||
return false;
|
||||
}
|
||||
final Resource other = (Resource) obj;
|
||||
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,8 +116,12 @@ public class Component extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public List<Component> getChildComponents() {
|
||||
if (childComponents == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(childComponents);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setChildComponents(final List<Component> childComponents) {
|
||||
this.childComponents = childComponents;
|
||||
|
|
@ -158,7 +162,12 @@ public class Component extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof Component)) {
|
||||
return false;
|
||||
}
|
||||
final Component other = (Component) obj;
|
||||
|
|
|
|||
|
|
@ -70,7 +70,12 @@ public class DataDrivenSelect extends Widget implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof DataDrivenSelect)) {
|
||||
return false;
|
||||
}
|
||||
final DataDrivenSelect other = (DataDrivenSelect) obj;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder;
|
||||
|
||||
import org.hibernate.annotations.CollectionId;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
|
@ -89,7 +87,12 @@ public class FormSection extends Component implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof FormSection)) {
|
||||
return false;
|
||||
}
|
||||
final FormSection other = (FormSection) obj;
|
||||
|
|
|
|||
|
|
@ -85,11 +85,16 @@ public class Listener extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof Listener)) {
|
||||
return false;
|
||||
}
|
||||
final Listener other = (Listener) obj;
|
||||
if (other.canEqual(this)) {
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -99,14 +104,11 @@ public class Listener extends CcmObject implements Serializable {
|
|||
if (!Objects.equals(attributeString, other.getAttributeString())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(widget, other.getWidget())) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return Objects.equals(widget, other.getWidget());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEqual(Object obj) {
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof Listener;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,12 @@ public class MetaObject extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof MetaObject)) {
|
||||
return false;
|
||||
}
|
||||
final MetaObject other = (MetaObject) obj;
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ public class ObjectType extends CcmObject implements Serializable {
|
|||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
int hash = super.hashCode();
|
||||
hash = 61 * hash + Objects.hashCode(appName);
|
||||
hash = 61 * hash + Objects.hashCode(className);
|
||||
return hash;
|
||||
|
|
@ -72,7 +72,12 @@ public class ObjectType extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof ObjectType)) {
|
||||
return false;
|
||||
}
|
||||
final ObjectType other = (ObjectType) obj;
|
||||
|
|
|
|||
|
|
@ -80,7 +80,12 @@ public class Option extends Component implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof Option)) {
|
||||
return false;
|
||||
}
|
||||
final Option other = (Option) obj;
|
||||
|
|
|
|||
|
|
@ -100,7 +100,12 @@ public class PersistentDataQuery extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof PersistentDataQuery)) {
|
||||
return false;
|
||||
}
|
||||
final PersistentDataQuery other = (PersistentDataQuery) obj;
|
||||
|
|
|
|||
|
|
@ -126,7 +126,12 @@ public class ProcessListener extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof ProcessListener)) {
|
||||
return false;
|
||||
}
|
||||
final ProcessListener other = (ProcessListener) obj;
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder;
|
||||
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
|
@ -88,8 +87,12 @@ public class Widget extends Component implements Serializable {
|
|||
}
|
||||
|
||||
public List<Listener> getListeners() {
|
||||
if (listeners == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(listeners);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setListeners(final List<Listener> listeners) {
|
||||
this.listeners = listeners;
|
||||
|
|
@ -103,7 +106,6 @@ public class Widget extends Component implements Serializable {
|
|||
listeners.remove(listener);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
|
|
@ -120,7 +122,12 @@ public class Widget extends Component implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof Widget)) {
|
||||
return false;
|
||||
}
|
||||
final Widget other = (Widget) obj;
|
||||
|
|
@ -144,6 +151,11 @@ public class Widget extends Component implements Serializable {
|
|||
return Objects.equals(listeners, other.getListeners());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof Widget;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(final String data) {
|
||||
return super.toString(String.format(", parameterName = \"%s\", "
|
||||
|
|
|
|||
|
|
@ -59,7 +59,12 @@ public class WidgetLabel extends Component implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof WidgetLabel)) {
|
||||
return false;
|
||||
}
|
||||
final WidgetLabel other = (WidgetLabel) obj;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,12 @@ public class ConfirmEmailListener
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof ConfirmEmailListener)) {
|
||||
return false;
|
||||
}
|
||||
final ConfirmEmailListener other = (ConfirmEmailListener) obj;
|
||||
|
|
|
|||
|
|
@ -47,7 +47,12 @@ public class ConfirmRedirectListener
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof ConfirmRedirectListener)) {
|
||||
return false;
|
||||
}
|
||||
final ConfirmRedirectListener other = (ConfirmRedirectListener) obj;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,12 @@ public class RemoteServerPostListener
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof RemoteServerPostListener)) {
|
||||
return false;
|
||||
}
|
||||
final RemoteServerPostListener other = (RemoteServerPostListener) obj;
|
||||
|
|
@ -53,7 +58,12 @@ public class RemoteServerPostListener
|
|||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(this.remoteUrl, other.remoteUrl);
|
||||
return Objects.equals(this.remoteUrl, other.getRemoteUrl());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof RemoteServerPostListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -62,7 +62,12 @@ public class SimpleEmailListener
|
|||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof SimpleEmailListener)) {
|
||||
return false;
|
||||
}
|
||||
final SimpleEmailListener other = (SimpleEmailListener) obj;
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ public class TemplateEmailListener
|
|||
@Override
|
||||
public int hashCode() {
|
||||
int hash = super.hashCode();
|
||||
hash = 67 * hash + Objects.hashCode(this.recipient);
|
||||
hash = 67 * hash + Objects.hashCode(this.subject);
|
||||
hash = 67 * hash + Objects.hashCode(this.body);
|
||||
hash = 67 * hash + Objects.hashCode(recipient);
|
||||
hash = 67 * hash + Objects.hashCode(subject);
|
||||
hash = 67 * hash + Objects.hashCode(body);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +73,12 @@ public class TemplateEmailListener
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof TemplateEmailListener)) {
|
||||
return false;
|
||||
}
|
||||
final TemplateEmailListener other = (TemplateEmailListener) obj;
|
||||
|
|
@ -81,13 +86,13 @@ public class TemplateEmailListener
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!Objects.equals(this.recipient, other.recipient)) {
|
||||
if (!Objects.equals(recipient, other.getRecipient())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(this.subject, other.subject)) {
|
||||
if (!Objects.equals(subject, other.getSubject())) {
|
||||
return false;
|
||||
}
|
||||
return Objects.equals(this.body, other.body);
|
||||
return Objects.equals(body, other.getBody());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -57,7 +57,12 @@ public class XmlEmailListener extends ProcessListener implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof XmlEmailListener)) {
|
||||
return false;
|
||||
}
|
||||
final XmlEmailListener other = (XmlEmailListener) obj;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import java.util.Collections;
|
|||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.persistence.Column;
|
||||
|
|
@ -158,6 +159,34 @@ public class LocalizedString implements Serializable {
|
|||
return values.keySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 7;
|
||||
hash = 41 * hash + Objects.hashCode(this.values);
|
||||
return hash;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(final Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof LocalizedString)) {
|
||||
return false;
|
||||
}
|
||||
final LocalizedString other = (LocalizedString) obj;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(values, other.getValues());
|
||||
}
|
||||
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof LocalizedString;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format(
|
||||
|
|
@ -165,7 +194,7 @@ public class LocalizedString implements Serializable {
|
|||
+ "%s"
|
||||
+ " }",
|
||||
super.toString(),
|
||||
values.toString());
|
||||
Objects.toString(values));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,12 +110,20 @@ public class Attachment implements Serializable {
|
|||
}
|
||||
|
||||
public byte[] getData() {
|
||||
if (data == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Arrays.copyOf(data, data.length);
|
||||
}
|
||||
}
|
||||
|
||||
public void setData(byte[] data) {
|
||||
if (data == null) {
|
||||
this.data = null;
|
||||
} else {
|
||||
this.data = Arrays.copyOf(data, data.length);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
|
@ -135,7 +143,7 @@ public class Attachment implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Attachment)) {
|
||||
return false;
|
||||
}
|
||||
final Attachment other = (Attachment) obj;
|
||||
|
|
|
|||
|
|
@ -111,12 +111,20 @@ public class Message extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public Date getSent() {
|
||||
if (sent == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(sent.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setSent(final Date sent) {
|
||||
if (sent == null) {
|
||||
this.sent = null;
|
||||
} else {
|
||||
this.sent = new Date(sent.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public Message getInReplyTo() {
|
||||
return inReplyTo;
|
||||
|
|
@ -127,8 +135,12 @@ public class Message extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public List<Message> getReplies() {
|
||||
if (replies == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(replies);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setReplies(final List<Message> replies) {
|
||||
this.replies = replies;
|
||||
|
|
@ -143,8 +155,12 @@ public class Message extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public List<Attachment> getAttachments() {
|
||||
if (attachments == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(attachments);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setAttachments(final List<Attachment> attachments) {
|
||||
this.attachments = attachments;
|
||||
|
|
@ -177,11 +193,16 @@ public class Message extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof Message)) {
|
||||
return false;
|
||||
}
|
||||
final Message other = (Message) obj;
|
||||
if (!other.canEqual(obj)) {
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,12 @@ public class MessageThread extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof MessageThread)) {
|
||||
return false;
|
||||
}
|
||||
final MessageThread other = (MessageThread) obj;
|
||||
|
|
@ -70,7 +75,7 @@ public class MessageThread extends CcmObject implements Serializable {
|
|||
return false;
|
||||
}
|
||||
|
||||
return Objects.equals(this.root, other.getRoot());
|
||||
return Objects.equals(root, other.getRoot());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ import java.util.Objects;
|
|||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinColumn;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.Temporal;
|
||||
|
|
@ -124,12 +123,20 @@ public class Digest extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public Date getNextRun() {
|
||||
if (nextRun == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(nextRun.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setNextRun(final Date nextRun) {
|
||||
if (nextRun == null) {
|
||||
this.nextRun = null;
|
||||
} else {
|
||||
this.nextRun = new Date(nextRun.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
|
|
@ -149,11 +156,12 @@ public class Digest extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
if (!(obj instanceof Digest)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -36,34 +36,30 @@ import javax.persistence.TemporalType;
|
|||
|
||||
/**
|
||||
*
|
||||
*The {@code Notification} class is used to create and send
|
||||
* messages via email to ACS users and groups. It acts as a wrapper
|
||||
* for a {@link Message} which contains the subject, sender, body and
|
||||
* any attachments for the email. The recipient can be a {@link
|
||||
* com.arsdigita.kernel.User} or a {@link org.libreccm.core.Group}.
|
||||
* In the case of Group, the message can be sent to the group's email
|
||||
* address or expanded into a separate message for each member of the
|
||||
* group.
|
||||
* The {@code Notification} class is used to create and send messages via email
|
||||
* to ACS users and groups. It acts as a wrapper for a {@link Message} which
|
||||
* contains the subject, sender, body and any attachments for the email. The
|
||||
* recipient can be a {@link
|
||||
* com.arsdigita.kernel.User} or a {@link org.libreccm.core.Group}. In the case
|
||||
* of Group, the message can be sent to the group's email address or expanded
|
||||
* into a separate message for each member of the group.
|
||||
*
|
||||
* <h4>Email Alerts</h4>
|
||||
*
|
||||
* When using notifications for email alerts, applications often
|
||||
* need to wrap a special header and signature around the contained
|
||||
* Message object. This can be useful for including introductory
|
||||
* remarks and action links in the email body. The
|
||||
* {@code setHeader} and {@code setSignature} methods allow
|
||||
* you to do this without the need to create a separate Message for
|
||||
* the modified email.
|
||||
* *
|
||||
* When using notifications for email alerts, applications often need to wrap a
|
||||
* special header and signature around the contained Message object. This can be
|
||||
* useful for including introductory remarks and action links in the email body.
|
||||
* The {@code setHeader} and {@code setSignature} methods allow you to do this
|
||||
* without the need to create a separate Message for the modified email.
|
||||
*
|
||||
* <h4>Digests</h4>
|
||||
*
|
||||
* Finally, notifications can be sent in "instant processing mode"
|
||||
* or as part of a {@link Digest}. When sent as part of a digest all
|
||||
* notifications to the same recipient are collected into a single
|
||||
* email and sent at regular internal. For example, an hourly digest
|
||||
* might send a user all of their workflow task updates that have
|
||||
* changed in the past hour, rather a much larger number of individual
|
||||
* messages every time an tasks changed.
|
||||
* Finally, notifications can be sent in "instant processing mode" or as part of
|
||||
* a {@link Digest}. When sent as part of a digest all notifications to the same
|
||||
* recipient are collected into a single email and sent at regular internal. For
|
||||
* example, an hourly digest might send a user all of their workflow task
|
||||
* updates that have changed in the past hour, rather a much larger number of
|
||||
* individual messages every time an tasks changed.
|
||||
*
|
||||
* (Documentation taken from the {@code com.arsdigita.notification.Notification}
|
||||
* class)
|
||||
|
|
@ -166,20 +162,36 @@ public class Notification extends CcmObject implements Serializable {
|
|||
}
|
||||
|
||||
public Date getRequestDate() {
|
||||
if (requestDate == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(requestDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setRequestDate(final Date requestDate) {
|
||||
if (requestDate == null) {
|
||||
this.requestDate = null;
|
||||
} else {
|
||||
this.requestDate = new Date(requestDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public Date getFulfillDate() {
|
||||
if (fulfillDate == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(fulfillDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setFulfillDate(final Date fulfillDate) {
|
||||
if (fulfillDate == null) {
|
||||
this.fulfillDate = null;
|
||||
} else {
|
||||
this.fulfillDate = new Date(fulfillDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
|
|
@ -236,7 +248,7 @@ public class Notification extends CcmObject implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Notification)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -160,10 +160,14 @@ public class QueueItem implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof QueueItem)) {
|
||||
return false;
|
||||
}
|
||||
final QueueItem other = (QueueItem) obj;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.queueItemId != other.getQueueItemId()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,8 +62,12 @@ public class Portal extends Resource implements Serializable {
|
|||
}
|
||||
|
||||
public List<Portlet> getPortlets() {
|
||||
if (portlets == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(portlets);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setPortlets(final List<Portlet> portlets) {
|
||||
this.portlets = portlets;
|
||||
|
|
@ -90,11 +94,12 @@ public class Portal extends Resource implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
if (!(obj instanceof Portal)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,16 +88,17 @@ public class Portlet extends Resource implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof Portlet)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final Portlet other = (Portlet) obj;
|
||||
if (!other.canEqual(obj)) {
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -90,8 +90,12 @@ public class Initalizer implements Serializable {
|
|||
}
|
||||
|
||||
public List<Initalizer> getRequiredInitializers() {
|
||||
if (requiredInitializers == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(requiredInitializers);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setRequiredInitializers(
|
||||
final List<Initalizer> requiredInitializers) {
|
||||
|
|
@ -122,7 +126,7 @@ public class Initalizer implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Initalizer)) {
|
||||
return false;
|
||||
}
|
||||
final Initalizer other = (Initalizer) obj;
|
||||
|
|
|
|||
|
|
@ -59,13 +59,13 @@ public class Document implements Serializable {
|
|||
|
||||
@Column(name = "document_timestamp")
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date documentTimeStamp;
|
||||
private Date timeStamp;
|
||||
|
||||
@Column(name = "dirty")
|
||||
private long dirty;
|
||||
|
||||
@Column(name = "document_language", length = 8)
|
||||
private String documentLanguage;
|
||||
private String language;
|
||||
|
||||
@Column(name = "country", length = 8)
|
||||
private String country;
|
||||
|
|
@ -127,12 +127,20 @@ public class Document implements Serializable {
|
|||
this.typeSpecificInfo = typeSpecificInfo;
|
||||
}
|
||||
|
||||
public Date getDocumentTimeStamp() {
|
||||
return new Date(documentTimeStamp.getTime());
|
||||
public Date getTimeStamp() {
|
||||
if (timeStamp == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(timeStamp.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setDocumentTimeStamp(final Date documentTimeStamp) {
|
||||
this.documentTimeStamp = new Date(documentTimeStamp.getTime());
|
||||
public void setTimeStamp(final Date timeStamp) {
|
||||
if (timeStamp == null) {
|
||||
this.timeStamp = null;
|
||||
} else {
|
||||
this.timeStamp = new Date(timeStamp.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public long getDirty() {
|
||||
|
|
@ -143,12 +151,12 @@ public class Document implements Serializable {
|
|||
this.dirty = dirty;
|
||||
}
|
||||
|
||||
public String getDocumentLanguage() {
|
||||
return documentLanguage;
|
||||
public String getLanguage() {
|
||||
return language;
|
||||
}
|
||||
|
||||
public void setDocumentLanguage(final String documentLanguage) {
|
||||
this.documentLanguage = documentLanguage;
|
||||
public void setLanguage(final String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public String getCountry() {
|
||||
|
|
@ -184,12 +192,20 @@ public class Document implements Serializable {
|
|||
}
|
||||
|
||||
public Date getCreated() {
|
||||
if (created == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(created.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setCreated(final Date created) {
|
||||
if (created == null) {
|
||||
this.created = null;
|
||||
} else {
|
||||
this.created = new Date(created.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public Party getCreatedBy() {
|
||||
return createdBy;
|
||||
|
|
@ -200,12 +216,20 @@ public class Document implements Serializable {
|
|||
}
|
||||
|
||||
public Date getLastModified() {
|
||||
if (lastModified == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(lastModified.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setLastModified(final Date lastModified) {
|
||||
if (lastModified == null) {
|
||||
this.lastModified = null;
|
||||
} else {
|
||||
this.lastModified = new Date(lastModified.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public Party getLastModifiedBy() {
|
||||
return lastModifiedBy;
|
||||
|
|
@ -229,9 +253,9 @@ public class Document implements Serializable {
|
|||
hash = 53 * hash + (int) (documentId ^ (documentId >>> 32));
|
||||
hash = 53 * hash + Objects.hashCode(type);
|
||||
hash = 53 * hash + Objects.hashCode(typeSpecificInfo);
|
||||
hash = 53 * hash + Objects.hashCode(documentTimeStamp);
|
||||
hash = 53 * hash + Objects.hashCode(timeStamp);
|
||||
hash = 53 * hash + (int) (dirty ^ (dirty >>> 32));
|
||||
hash = 53 * hash + Objects.hashCode(documentLanguage);
|
||||
hash = 53 * hash + Objects.hashCode(language);
|
||||
hash = 53 * hash + Objects.hashCode(country);
|
||||
hash = 53 * hash + Objects.hashCode(title);
|
||||
hash = 53 * hash + Objects.hashCode(summary);
|
||||
|
|
@ -249,10 +273,14 @@ public class Document implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Document)) {
|
||||
return false;
|
||||
}
|
||||
final Document other = (Document) obj;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (documentId != other.getDocumentId()) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -262,13 +290,13 @@ public class Document implements Serializable {
|
|||
if (!Objects.equals(typeSpecificInfo, other.getTypeSpecificInfo())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(documentTimeStamp, other.getDocumentTimeStamp())) {
|
||||
if (!Objects.equals(timeStamp, other.getTimeStamp())) {
|
||||
return false;
|
||||
}
|
||||
if (dirty != other.getDirty()) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(documentLanguage, other.getDocumentLanguage())) {
|
||||
if (!Objects.equals(language, other.getLanguage())) {
|
||||
return false;
|
||||
}
|
||||
if (!Objects.equals(country, other.getCountry())) {
|
||||
|
|
@ -298,6 +326,10 @@ public class Document implements Serializable {
|
|||
return Objects.equals(contentSection, other.getContentSection());
|
||||
}
|
||||
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof Document;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s{ "
|
||||
|
|
@ -317,9 +349,9 @@ public class Document implements Serializable {
|
|||
super.toString(),
|
||||
documentId,
|
||||
type,
|
||||
documentTimeStamp,
|
||||
timeStamp,
|
||||
dirty,
|
||||
documentLanguage,
|
||||
language,
|
||||
country,
|
||||
title,
|
||||
created,
|
||||
|
|
|
|||
|
|
@ -97,10 +97,14 @@ public class Index implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Index)) {
|
||||
return false;
|
||||
}
|
||||
final Index other = (Index) obj;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (indexId != other.getIndexId()) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -110,6 +114,10 @@ public class Index implements Serializable {
|
|||
return luceneIndexId == other.getLuceneIndexId();
|
||||
}
|
||||
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof Index;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s{ "
|
||||
|
|
|
|||
|
|
@ -80,11 +80,12 @@ public class Application extends Resource implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
if (!(obj instanceof Application)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -99,6 +100,11 @@ public class Application extends Resource implements Serializable {
|
|||
return Objects.equals(containerGroup, other.getContainerGroup());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof Application;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(final String data) {
|
||||
return super.toString(String.format(", primaryUrl = \"%s\", "
|
||||
|
|
|
|||
|
|
@ -90,10 +90,13 @@ public class Host implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Host)) {
|
||||
return false;
|
||||
}
|
||||
final Host other = (Host) obj;
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
if (this.hostId != other.getHostId()) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -103,6 +106,10 @@ public class Host implements Serializable {
|
|||
return this.serverPort == other.getServerPort();
|
||||
}
|
||||
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof Host;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.format("%s{ "
|
||||
|
|
|
|||
|
|
@ -163,8 +163,12 @@ public class Task implements Serializable {
|
|||
}
|
||||
|
||||
public List<Task> getDependentTasks() {
|
||||
if (dependentTasks == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(dependentTasks);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setDependentTasks(final List<Task> dependentTasks) {
|
||||
this.dependentTasks = dependentTasks;
|
||||
|
|
@ -179,8 +183,12 @@ public class Task implements Serializable {
|
|||
}
|
||||
|
||||
public List<Task> getDependsOn() {
|
||||
if (dependsOn == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(dependsOn);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setDependsOn(final List<Task> dependsOn) {
|
||||
this.dependsOn = dependsOn;
|
||||
|
|
@ -195,8 +203,12 @@ public class Task implements Serializable {
|
|||
}
|
||||
|
||||
public List<String> getComments() {
|
||||
if (comments == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(comments);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setComments(final List<String> comments) {
|
||||
this.comments = comments;
|
||||
|
|
@ -230,11 +242,11 @@ public class Task implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Task)) {
|
||||
return false;
|
||||
}
|
||||
final Task other = (Task) obj;
|
||||
if (!other.canEqual(obj)) {
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -294,4 +306,5 @@ public class Task implements Serializable {
|
|||
Objects.toString(dependsOn),
|
||||
data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,20 +109,36 @@ public class UserTask extends Task implements Serializable {
|
|||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
if (startDate == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(startDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setStartDate(final Date startDate) {
|
||||
if (startDate == null) {
|
||||
this.startDate = null;
|
||||
} else {
|
||||
this.startDate = new Date(startDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public Date getDueDate() {
|
||||
if (dueDate == null) {
|
||||
return null;
|
||||
} else {
|
||||
return new Date(dueDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public void setDueDate(final Date dueDate) {
|
||||
if (dueDate == null) {
|
||||
this.dueDate = null;
|
||||
} else {
|
||||
this.dueDate = new Date(dueDate.getTime());
|
||||
}
|
||||
}
|
||||
|
||||
public long getDurationMinutes() {
|
||||
return durationMinutes;
|
||||
|
|
@ -141,8 +157,12 @@ public class UserTask extends Task implements Serializable {
|
|||
}
|
||||
|
||||
public List<User> getAssignedUsers() {
|
||||
if (assignedUsers == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(assignedUsers);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setAssignedUsers(final List<User> assignedUsers) {
|
||||
this.assignedUsers = assignedUsers;
|
||||
|
|
@ -157,8 +177,12 @@ public class UserTask extends Task implements Serializable {
|
|||
}
|
||||
|
||||
public List<UserGroup> getAssignedGroups() {
|
||||
if (assignedGroups == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(assignedGroups);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setAssignedGroups(final List<UserGroup> assignedGroups) {
|
||||
this.assignedGroups = assignedGroups;
|
||||
|
|
@ -192,11 +216,16 @@ public class UserTask extends Task implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
|
||||
if (!super.equals(obj)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(obj instanceof UserTask)) {
|
||||
return false;
|
||||
}
|
||||
final UserTask other = (UserTask) obj;
|
||||
if (!other.canEqual(obj)) {
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -224,6 +253,11 @@ public class UserTask extends Task implements Serializable {
|
|||
return Objects.equals(assignedGroups, other.getAssignedGroups());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canEqual(final Object obj) {
|
||||
return obj instanceof UserTask;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(final String data) {
|
||||
return super.toString(String.format(", locked = %b, "
|
||||
|
|
|
|||
|
|
@ -106,8 +106,12 @@ public class Workflow implements Serializable {
|
|||
}
|
||||
|
||||
public List<Task> getTasks() {
|
||||
if (tasks == null) {
|
||||
return null;
|
||||
} else {
|
||||
return Collections.unmodifiableList(tasks);
|
||||
}
|
||||
}
|
||||
|
||||
protected void setTasks(final List<Task> tasks) {
|
||||
this.tasks = tasks;
|
||||
|
|
@ -135,11 +139,11 @@ public class Workflow implements Serializable {
|
|||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (!(obj instanceof Workflow)) {
|
||||
return false;
|
||||
}
|
||||
final Workflow other = (Workflow) obj;
|
||||
if (!other.canEqual(obj)) {
|
||||
if (!other.canEqual(this)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,9 +18,11 @@
|
|||
*/
|
||||
package org.libreccm.categorization;
|
||||
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -32,7 +34,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@org.junit.experimental.categories.Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -43,8 +47,32 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
DomainOwnership.class});
|
||||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entitiesClass) {
|
||||
super(entitiesClass);
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Category category1 = new Category();
|
||||
category1.setName("Category One");
|
||||
|
||||
final Category category2 = new Category();
|
||||
category2.setName("Category Two");
|
||||
|
||||
final Domain domain1 = new Domain();
|
||||
domain1.setDomainKey("Domain-One");
|
||||
|
||||
final Domain domain2 = new Domain();
|
||||
domain2.setDomainKey("Domain Two");
|
||||
|
||||
EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Category.class, category1, category2)
|
||||
.withPrefabValues(Domain.class, domain1, domain2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,12 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder;
|
||||
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -33,11 +35,13 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
return Arrays.asList(new Class<?>[] {
|
||||
return Arrays.asList(new Class<?>[]{
|
||||
Component.class,
|
||||
DataDrivenSelect.class,
|
||||
FormSection.class,
|
||||
|
|
@ -53,6 +57,45 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
super(entityClass);
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Component component1 = new Component();
|
||||
component1.setAdminName("Component One");
|
||||
|
||||
final Component component2 = new Component();
|
||||
component2.setAdminName("Component Two");
|
||||
|
||||
final WidgetLabel widgetLabel1 = new WidgetLabel();
|
||||
widgetLabel1.setAdminName("WidgetLabel One");
|
||||
|
||||
final WidgetLabel widgetLabel2 = new WidgetLabel();
|
||||
widgetLabel2.setAdminName("WidgetLabel Two");
|
||||
|
||||
final Widget widget1 = new Widget();
|
||||
widget1.setAdminName("Widget 1");
|
||||
|
||||
final Widget widget2 = new Widget();
|
||||
widget2.setAdminName("Widget 2");
|
||||
|
||||
final FormSection formSection1 = new FormSection();
|
||||
formSection1.setAdminName("FormSection One");
|
||||
|
||||
final FormSection formSection2 = new FormSection();
|
||||
formSection2.setAdminName("FormSection Two");
|
||||
|
||||
EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Component.class, component1, component2)
|
||||
.withPrefabValues(WidgetLabel.class, widgetLabel1, widgetLabel2)
|
||||
.withPrefabValues(Widget.class, widget1, widget2)
|
||||
.withPrefabValues(FormSection.class, formSection1, formSection2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,10 +18,14 @@
|
|||
*/
|
||||
package org.libreccm.formbuilder.actions;
|
||||
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
import org.libreccm.formbuilder.Component;
|
||||
import org.libreccm.formbuilder.FormSection;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
|
@ -33,7 +37,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -48,7 +54,31 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
super(entityClass);
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Component component1 = new Component();
|
||||
component1.setAdminName("Component One");
|
||||
|
||||
final Component component2 = new Component();
|
||||
component2.setAdminName("Component Two");
|
||||
|
||||
final FormSection formSection1 = new FormSection();
|
||||
formSection1.setAdminName("FormSection One");
|
||||
|
||||
final FormSection formSection2 = new FormSection();
|
||||
formSection2.setAdminName("FormSection Two");
|
||||
|
||||
EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Component.class, component1, component2)
|
||||
.withPrefabValues(FormSection.class, formSection1, formSection2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,9 +18,12 @@
|
|||
*/
|
||||
package org.libreccm.l10n;
|
||||
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.messaging.Message;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
|
||||
|
|
@ -33,7 +36,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -43,7 +48,26 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
super(entityClass);
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Message message1 = new Message();
|
||||
message1.setSubject("Message One");
|
||||
|
||||
final Message message2 = new Message();
|
||||
message2.setSubject("Message Two");
|
||||
|
||||
nl.jqno.equalsverifier.EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Message.class, message1, message2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,12 @@
|
|||
*/
|
||||
package org.libreccm.messaging;
|
||||
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
|
@ -33,7 +34,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -45,7 +48,24 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
super(entityClass);
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Message message1 = new Message();
|
||||
message1.setSubject("Message One");
|
||||
|
||||
final Message message2 = new Message();
|
||||
message2.setSubject("Message Two");
|
||||
|
||||
nl.jqno.equalsverifier.EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Message.class, message1, message2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,14 @@
|
|||
*/
|
||||
package org.libreccm.notification;
|
||||
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.messaging.Message;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
|
@ -33,7 +36,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -45,7 +50,24 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
super(entityClass);
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Message message1 = new Message();
|
||||
message1.setSubject("Message One");
|
||||
|
||||
final Message message2 = new Message();
|
||||
message2.setSubject("Message Two");
|
||||
|
||||
EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Message.class, message1, message2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,14 @@
|
|||
*/
|
||||
package org.libreccm.portal;
|
||||
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.core.Resource;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
|
@ -33,7 +36,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -44,6 +49,31 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityTest) {
|
||||
super(entityTest);
|
||||
this.entityClass = entityTest;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Portal portal1 = new Portal();
|
||||
portal1.setDisplayName("Portal One");
|
||||
|
||||
final Portal portal2 = new Portal();
|
||||
portal2.setDisplayName("Portal Two");
|
||||
|
||||
final Resource resource1 = new Resource();
|
||||
resource1.setDisplayName("Resource One");
|
||||
|
||||
final Resource resource2 = new Resource();
|
||||
resource2.setDisplayName("Resource Two");
|
||||
|
||||
EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Portal.class, portal1, portal2)
|
||||
.withPrefabValues(Resource.class, resource1, resource2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,13 @@
|
|||
*/
|
||||
package org.libreccm.runtime;
|
||||
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
|
@ -33,7 +35,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -43,8 +47,24 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
super(entityClass);
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Initalizer initalizer1 = new Initalizer();
|
||||
initalizer1.setClassName("org.example.foo.Initalizer");
|
||||
|
||||
final Initalizer initalizer2 = new Initalizer();
|
||||
initalizer2.setClassName("org.example.bar.Initalizer");
|
||||
|
||||
EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Initalizer.class, initalizer1, initalizer2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,11 +18,14 @@
|
|||
*/
|
||||
package org.libreccm.web;
|
||||
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import nl.jqno.equalsverifier.Warning;
|
||||
import org.junit.Test;
|
||||
import org.junit.experimental.categories.Category;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.junit.runners.Parameterized;
|
||||
import org.libreccm.core.Resource;
|
||||
import org.libreccm.tests.categories.UnitTest;
|
||||
import org.libreccm.testutils.EqualsVerifier;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
|
|
@ -33,7 +36,9 @@ import java.util.Collection;
|
|||
*/
|
||||
@RunWith(Parameterized.class)
|
||||
@Category(UnitTest.class)
|
||||
public class EqualsAndHashCodeTest extends EqualsVerifier {
|
||||
public class EqualsAndHashCodeTest {
|
||||
|
||||
private final Class<?> entityClass;
|
||||
|
||||
@Parameterized.Parameters(name = "{0}")
|
||||
public static Collection<Class<?>> data() {
|
||||
|
|
@ -44,7 +49,24 @@ public class EqualsAndHashCodeTest extends EqualsVerifier {
|
|||
}
|
||||
|
||||
public EqualsAndHashCodeTest(final Class<?> entityClass) {
|
||||
super(entityClass);
|
||||
this.entityClass = entityClass;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifyEqualsAndHashCode() {
|
||||
final Resource resource1 = new Resource();
|
||||
resource1.setDisplayName("Resource One");
|
||||
|
||||
final Resource resource2 = new Resource();
|
||||
resource2.setDisplayName("Resource Two");
|
||||
|
||||
EqualsVerifier
|
||||
.forClass(entityClass)
|
||||
.suppress(Warning.STRICT_INHERITANCE)
|
||||
.suppress(Warning.NONFINAL_FIELDS)
|
||||
.withRedefinedSuperclass()
|
||||
.withPrefabValues(Resource.class, resource1, resource2)
|
||||
.verify();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue