source: events/src/main/java/geniusweb/actions/AbstractAction.java@ 53

Last change on this file since 53 was 52, checked in by ruud, 21 months ago

Fixed small issues in domaineditor.

File size: 1.4 KB
Line 
1package geniusweb.actions;
2
3import com.fasterxml.jackson.annotation.JsonAutoDetect;
4import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
5import com.fasterxml.jackson.annotation.JsonCreator;
6import com.fasterxml.jackson.annotation.JsonProperty;
7
8@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE, isGetterVisibility = Visibility.NONE)
9public class AbstractAction implements Action {
10
11 private PartyId actor;
12
13 /**
14 *
15 * @param id the {@link PartyId} of the party executing the action. Usually
16 * the negotiation system will check that parties only use their
17 * own Id when doing actions.
18 */
19 @JsonCreator
20 public AbstractAction(@JsonProperty("actor") PartyId id) {
21 this.actor = id;
22 }
23
24 @Override
25 public PartyId getActor() {
26 return actor;
27 }
28
29 @Override
30 public int hashCode() {
31 final int prime = 31;
32 int result = 1;
33 result = prime * result + ((actor == null) ? 0 : actor.hashCode());
34 return result;
35 }
36
37 @Override
38 public boolean equals(Object obj) {
39 if (this == obj)
40 return true;
41 if (obj == null)
42 return false;
43 if (getClass() != obj.getClass())
44 return false;
45 AbstractAction other = (AbstractAction) obj;
46 if (actor == null) {
47 if (other.actor != null)
48 return false;
49 } else if (!actor.equals(other.actor))
50 return false;
51 return true;
52 }
53
54}
Note: See TracBrowser for help on using the repository browser.