Skip to main content
summaryrefslogtreecommitdiffstats
blob: 0198e2b2b11947d821244a41364885494960810b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/*******************************************************************************
 * Copyright (c) 2004, 2007 Boeing.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Boeing - initial API and implementation
 *******************************************************************************/
package org.eclipse.osee.framework.messaging.event.skynet.event;

import java.util.Collection;
import org.eclipse.osee.framework.messaging.event.skynet.ISkynetEvent;

/**
 * @author Donald G. Dunne
 */
public abstract class SkynetArtifactsEventBase extends SkynetEventBase implements ISkynetEvent {
   private static final long serialVersionUID = 7923550763258313718L;

   private final Collection<Integer> artifactTypeIds;
   private final Collection<Integer> artifactIds;
   private final int branchId;

   /**
    * @param branchId
    * @param artifactIds
    * @param artifactTypeIds
    * @param author
    */
   public SkynetArtifactsEventBase(int branchId, Collection<Integer> artifactIds, Collection<Integer> artifactTypeIds, NetworkSender networkSender) {
      super(networkSender);
      this.branchId = branchId;
      this.artifactIds = artifactIds;
      this.artifactTypeIds = artifactTypeIds;
   }

   /**
    * @return the branchId
    */
   public int getId() {
      return branchId;
   }

   /**
    * @return the artifactTypeIds
    */
   public Collection<Integer> getArtifactTypeIds() {
      return artifactTypeIds;
   }

   /**
    * @return the artifactIds
    */
   public Collection<Integer> getArtifactIds() {
      return artifactIds;
   }

   @Override
   public boolean equals(Object obj) {
      if (obj instanceof NetworkArtifactPurgeEvent) {
         return artifactIds.hashCode() == ((NetworkArtifactPurgeEvent) obj).getArtifactIds().hashCode() && artifactTypeIds.hashCode() == ((NetworkArtifactPurgeEvent) obj).getArtifactTypeIds().hashCode();
      }
      return super.equals(obj);
   }

   @Override
   public int hashCode() {
      return artifactIds.hashCode() + artifactTypeIds.hashCode();
   }

}

Back to the top