You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2019/12/16 15:14:57 UTC

[sling-whiteboard] branch master updated: Separate out the ArtifactID from the artifacts

This is an automated email from the ASF dual-hosted git repository.

davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 60eed9a  Separate out the ArtifactID from the artifacts
60eed9a is described below

commit 60eed9af7f2c1aa0da0893f4dcd20d10f416a813
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Mon Dec 16 15:14:32 2019 +0000

    Separate out the ArtifactID from the artifacts
---
 .../src/main/java/org/osgi/feature/Artifact.java   | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java b/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java
new file mode 100644
index 0000000..2841726
--- /dev/null
+++ b/osgi-featuremodel/src/main/java/org/osgi/feature/Artifact.java
@@ -0,0 +1,46 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with this
+ * work for additional information regarding copyright ownership. The ASF
+ * licenses this file to You under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.osgi.feature;
+
+import java.util.Objects;
+
+public class Artifact {
+    private final ArtifactID id;
+
+    protected Artifact(ArtifactID id) {
+        this.id = id;
+    }
+
+    public ArtifactID getId() {
+        return id;
+    }
+
+    @Override
+    public int hashCode() {
+        return Objects.hash(id);
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (!(obj instanceof Artifact))
+            return false;
+        Artifact other = (Artifact) obj;
+        return Objects.equals(id, other.id);
+    }
+}