-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aafbe2b
commit 5a4ecff
Showing
8 changed files
with
185 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...s/unmanaged-dependency-check/src/main/java/com/google/cloud/model/DependencyResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.google.cloud.model; | ||
|
||
import java.util.List; | ||
|
||
public class DependencyResponse { | ||
private List<Node> nodes; | ||
|
||
public DependencyResponse(List<Node> nodes) { | ||
this.nodes = nodes; | ||
} | ||
|
||
public List<Node> getNodes() { | ||
return nodes; | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
...cies/unmanaged-dependency-check/src/main/java/com/google/cloud/model/MavenCoordinate.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.google.cloud.model; | ||
|
||
public class MavenCoordinate { | ||
private final String groupId; | ||
private final String artifactId; | ||
private final String version; | ||
|
||
public MavenCoordinate(String groupId, String artifactId, String version) { | ||
this.groupId = groupId; | ||
this.artifactId = artifactId; | ||
this.version = version; | ||
} | ||
|
||
public String getGroupId() { | ||
return groupId; | ||
} | ||
|
||
public String getArtifactId() { | ||
return artifactId; | ||
} | ||
|
||
public String getVersion() { | ||
return version; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return String.format("%s:%s:%s", groupId, artifactId, version); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...ed-dependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/model/Node.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.google.cloud.model; | ||
|
||
public class Node { | ||
private final VersionKey versionKey; | ||
private final Relation relation; | ||
|
||
public Node(VersionKey versionKey, Relation relation) { | ||
this.versionKey = versionKey; | ||
this.relation = relation; | ||
} | ||
|
||
public VersionKey getVersionKey() { | ||
return versionKey; | ||
} | ||
|
||
public Relation getRelation() { | ||
return relation; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...ependencies/unmanaged-dependency-check/src/main/java/com/google/cloud/model/Relation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.google.cloud.model; | ||
|
||
public enum Relation { | ||
SELF, | ||
DIRECT | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...endencies/unmanaged-dependency-check/src/main/java/com/google/cloud/model/VersionKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.google.cloud.model; | ||
|
||
import org.apache.bcel.generic.NEW; | ||
|
||
public class VersionKey { | ||
private final String system; | ||
private final String name; | ||
private final String version; | ||
|
||
public VersionKey(String system, String name, String version) { | ||
this.system = system; | ||
this.name = name; | ||
this.version = version; | ||
} | ||
|
||
public MavenCoordinate toMavenCoordinate() { | ||
String[] splits = name.split(":"); | ||
return new MavenCoordinate(splits[0], splits[1], version); | ||
} | ||
} |