1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib.to;
20
21 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
22 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
23 import java.util.ArrayList;
24 import java.util.List;
25 import org.apache.commons.lang3.builder.EqualsBuilder;
26 import org.apache.commons.lang3.builder.HashCodeBuilder;
27 import org.apache.syncope.common.lib.BaseBean;
28
29 public class ProvisioningResult<E extends EntityTO> implements BaseBean {
30
31 private static final long serialVersionUID = 351317476398082746L;
32
33 private E entity;
34
35 private final List<PropagationStatus> propagationStatuses = new ArrayList<>();
36
37 public E getEntity() {
38 return entity;
39 }
40
41 public void setEntity(final E entity) {
42 this.entity = entity;
43 }
44
45 @JacksonXmlElementWrapper(localName = "propagationStatuses")
46 @JacksonXmlProperty(localName = "propagationStatus")
47 public List<PropagationStatus> getPropagationStatuses() {
48 return propagationStatuses;
49 }
50
51 @Override
52 public int hashCode() {
53 return new HashCodeBuilder().
54 append(entity).
55 build();
56 }
57
58 @Override
59 public boolean equals(final Object obj) {
60 if (this == obj) {
61 return true;
62 }
63 if (obj == null) {
64 return false;
65 }
66 if (getClass() != obj.getClass()) {
67 return false;
68 }
69 @SuppressWarnings("unchecked")
70 final ProvisioningResult<E> other = (ProvisioningResult<E>) obj;
71 return new EqualsBuilder().
72 append(entity, other.entity).
73 build();
74 }
75 }