-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
10 changed files
with
14 additions
and
495 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,7 @@ | ||
package io.gardenlinux.glvd.dto; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class Configuration { | ||
private List<Node> nodes; | ||
public record Configuration(List<Node> nodes) { | ||
|
||
public Configuration() { | ||
} | ||
|
||
public Configuration(List<Node> nodes) { | ||
this.nodes = nodes; | ||
} | ||
|
||
public List<Node> getNodes() { | ||
return nodes; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
Configuration that = (Configuration) o; | ||
return Objects.equals(nodes, that.nodes); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hashCode(nodes); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Configuration{" + | ||
"nodes=" + nodes + | ||
'}'; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,81 +1,6 @@ | ||
package io.gardenlinux.glvd.dto; | ||
|
||
import java.util.Objects; | ||
public record CpeMatch(String criteria, Deb deb, boolean vulnerable, String versionStartIncluding, | ||
String versionEndExcluding, String matchCriteriaId) { | ||
|
||
public class CpeMatch { | ||
private String criteria; | ||
private Deb deb; | ||
private boolean vulnerable; | ||
private String versionStartIncluding; | ||
private String versionEndExcluding; | ||
private String matchCriteriaId; | ||
|
||
public CpeMatch() { | ||
} | ||
|
||
|
||
public CpeMatch(String criteria, Deb deb, boolean vulnerable, String versionStartIncluding, String versionEndExcluding, String matchCriteriaId) { | ||
this.criteria = criteria; | ||
this.deb = deb; | ||
this.vulnerable = vulnerable; | ||
this.versionStartIncluding = versionStartIncluding; | ||
this.versionEndExcluding = versionEndExcluding; | ||
this.matchCriteriaId = matchCriteriaId; | ||
} | ||
|
||
public String getVersionStartIncluding() { | ||
return versionStartIncluding; | ||
} | ||
|
||
public String getCriteria() { | ||
return criteria; | ||
} | ||
|
||
public Deb getDeb() { | ||
return deb; | ||
} | ||
|
||
public boolean isVulnerable() { | ||
return vulnerable; | ||
} | ||
|
||
public String getVersionEndExcluding() { | ||
return versionEndExcluding; | ||
} | ||
|
||
public String getMatchCriteriaId() { | ||
return matchCriteriaId; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
CpeMatch cpeMatch = (CpeMatch) o; | ||
return vulnerable == cpeMatch.vulnerable && Objects.equals(criteria, cpeMatch.criteria) && Objects.equals(deb, cpeMatch.deb) && Objects.equals(versionStartIncluding, cpeMatch.versionStartIncluding) && Objects.equals(versionEndExcluding, cpeMatch.versionEndExcluding) && Objects.equals(matchCriteriaId, cpeMatch.matchCriteriaId); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = Objects.hashCode(criteria); | ||
result = 31 * result + Objects.hashCode(deb); | ||
result = 31 * result + Boolean.hashCode(vulnerable); | ||
result = 31 * result + Objects.hashCode(versionStartIncluding); | ||
result = 31 * result + Objects.hashCode(versionEndExcluding); | ||
result = 31 * result + Objects.hashCode(matchCriteriaId); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "CpeMatch{" + | ||
"criteria='" + criteria + '\'' + | ||
", deb=" + deb + | ||
", vulnerable=" + vulnerable + | ||
", versionStartIncluding='" + versionStartIncluding + '\'' + | ||
", versionEndExcluding='" + versionEndExcluding + '\'' + | ||
", matchCriteriaId='" + matchCriteriaId + '\'' + | ||
'}'; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,130 +1,10 @@ | ||
package io.gardenlinux.glvd.dto; | ||
|
||
import jakarta.annotation.Nonnull; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
|
||
public class Cve { | ||
|
||
private String id; | ||
|
||
@Nonnull | ||
private String lastModified; | ||
|
||
@Nonnull | ||
private String sourceIdentifier; | ||
|
||
private String published; | ||
|
||
private String vulnStatus; | ||
|
||
private List<Description> descriptions; | ||
|
||
private Object metrics; | ||
|
||
private List<Reference> references; | ||
|
||
private List<Weakness> weaknesses; | ||
|
||
private List<Configuration> configurations; | ||
|
||
|
||
public Cve() { | ||
} | ||
|
||
public Cve(String id, @Nonnull String lastModified, @Nonnull String sourceIdentifier, String published, String vulnStatus, List<Description> descriptions, Object metrics, List<Reference> references, List<Weakness> weaknesses, List<Configuration> configurations) { | ||
this.id = id; | ||
this.lastModified = lastModified; | ||
this.sourceIdentifier = sourceIdentifier; | ||
this.published = published; | ||
this.vulnStatus = vulnStatus; | ||
this.descriptions = descriptions; | ||
this.metrics = metrics; | ||
this.references = references; | ||
this.weaknesses = weaknesses; | ||
this.configurations = configurations; | ||
} | ||
public record Cve(String id, String lastModified, String sourceIdentifier, String published, String vulnStatus, | ||
List<Description> descriptions, Object metrics, List<Reference> references, List<Weakness> weaknesses, | ||
List<Configuration> configurations) { | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
@Nonnull | ||
public String getLastModified() { | ||
return lastModified; | ||
} | ||
|
||
@Nonnull | ||
public String getSourceIdentifier() { | ||
return sourceIdentifier; | ||
} | ||
|
||
public String getPublished() { | ||
return published; | ||
} | ||
|
||
public String getVulnStatus() { | ||
return vulnStatus; | ||
} | ||
|
||
public List<Description> getDescriptions() { | ||
return descriptions; | ||
} | ||
|
||
public Object getMetrics() { | ||
return metrics; | ||
} | ||
|
||
public List<Reference> getReferences() { | ||
return references; | ||
} | ||
|
||
public List<Weakness> getWeaknesses() { | ||
return weaknesses; | ||
} | ||
|
||
public List<Configuration> getConfigurations() { | ||
return configurations; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
Cve cve = (Cve) o; | ||
return Objects.equals(id, cve.id) && lastModified.equals(cve.lastModified) && sourceIdentifier.equals(cve.sourceIdentifier) && Objects.equals(published, cve.published) && Objects.equals(vulnStatus, cve.vulnStatus) && Objects.equals(descriptions, cve.descriptions) && Objects.equals(metrics, cve.metrics) && Objects.equals(references, cve.references) && Objects.equals(weaknesses, cve.weaknesses) && Objects.equals(configurations, cve.configurations); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = Objects.hashCode(id); | ||
result = 31 * result + lastModified.hashCode(); | ||
result = 31 * result + sourceIdentifier.hashCode(); | ||
result = 31 * result + Objects.hashCode(published); | ||
result = 31 * result + Objects.hashCode(vulnStatus); | ||
result = 31 * result + Objects.hashCode(descriptions); | ||
result = 31 * result + Objects.hashCode(metrics); | ||
result = 31 * result + Objects.hashCode(references); | ||
result = 31 * result + Objects.hashCode(weaknesses); | ||
result = 31 * result + Objects.hashCode(configurations); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Cve{" + | ||
"id='" + id + '\'' + | ||
", lastModified='" + lastModified + '\'' + | ||
", sourceIdentifier='" + sourceIdentifier + '\'' + | ||
", published='" + published + '\'' + | ||
", vulnStatus='" + vulnStatus + '\'' + | ||
", descriptions=" + descriptions + | ||
", metrics=" + metrics + | ||
", references=" + references + | ||
", weaknesses=" + weaknesses + | ||
", configurations=" + configurations + | ||
'}'; | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -1,56 +1,5 @@ | ||
package io.gardenlinux.glvd.dto; | ||
|
||
import java.util.Objects; | ||
public record Deb(String versionLatest, String versionEndExcluding, String cvssSeverity) { | ||
|
||
public class Deb { | ||
private String versionLatest; | ||
private String versionEndExcluding; | ||
private String cvssSeverity; | ||
|
||
public Deb() { | ||
} | ||
|
||
public Deb(String versionLatest, String versionEndExcluding, String cvssSeverity) { | ||
this.versionLatest = versionLatest; | ||
this.versionEndExcluding = versionEndExcluding; | ||
this.cvssSeverity = cvssSeverity; | ||
} | ||
|
||
public String getVersionLatest() { | ||
return versionLatest; | ||
} | ||
|
||
public String getVersionEndExcluding() { | ||
return versionEndExcluding; | ||
} | ||
|
||
public String getCvssSeverity() { | ||
return cvssSeverity; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
Deb deb = (Deb) o; | ||
return Objects.equals(versionLatest, deb.versionLatest) && Objects.equals(versionEndExcluding, deb.versionEndExcluding) && Objects.equals(cvssSeverity, deb.cvssSeverity); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = Objects.hashCode(versionLatest); | ||
result = 31 * result + Objects.hashCode(versionEndExcluding); | ||
result = 31 * result + Objects.hashCode(cvssSeverity); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Deb{" + | ||
"versionLatest='" + versionLatest + '\'' + | ||
", versionEndExcluding='" + versionEndExcluding + '\'' + | ||
", cvssSeverity='" + cvssSeverity + '\'' + | ||
'}'; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,42 +1,4 @@ | ||
package io.gardenlinux.glvd.dto; | ||
|
||
import java.util.Objects; | ||
|
||
public class Description { | ||
|
||
private String lang; | ||
|
||
private String value; | ||
|
||
public Description() { | ||
} | ||
|
||
public Description(String lang, String value) { | ||
this.lang = lang; | ||
this.value = value; | ||
} | ||
|
||
public String getLang() { | ||
return lang; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
Description that = (Description) o; | ||
return Objects.equals(lang, that.lang) && Objects.equals(value, that.value); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = Objects.hashCode(lang); | ||
result = 31 * result + Objects.hashCode(value); | ||
return result; | ||
} | ||
public record Description(String lang, String value) { | ||
} |
Oops, something went wrong.