├── .gitignore ├── CHANGELOG.md ├── LICENSE ├── src ├── test │ └── java │ │ └── com │ │ └── contrastsecurity │ │ └── sarif │ │ └── SerializationTests.java └── main │ └── java │ └── com │ └── contrastsecurity │ └── sarif │ ├── Content.java │ ├── Role.java │ ├── Headers.java │ ├── Headers__1.java │ ├── Parameters.java │ ├── Fingerprints.java │ ├── Hashes.java │ ├── PartialFingerprints.java │ ├── FinalState.java │ ├── EnvironmentVariables.java │ ├── ImmutableState.java │ ├── InitialState.java │ ├── OriginalUriBaseIds.java │ ├── InitialState__1.java │ ├── ImmutableState__1.java │ ├── State.java │ ├── MessageStrings.java │ ├── GlobalMessageStrings.java │ ├── PropertyBag.java │ ├── SpecialLocations.java │ ├── MultiformatMessageString.java │ ├── Stack.java │ ├── Replacement.java │ ├── Tool.java │ ├── CodeFlow.java │ ├── Fix.java │ ├── ConfigurationOverride.java │ ├── ArtifactChange.java │ ├── ToolComponentReference.java │ ├── ArtifactContent.java │ ├── Graph.java │ ├── ExternalPropertyFileReference.java │ ├── Conversion.java │ ├── LocationRelationship.java │ ├── Message.java │ ├── Node.java │ ├── StackFrame.java │ ├── ReportingDescriptorRelationship.java │ ├── Edge.java │ ├── EdgeTraversal.java │ ├── ArtifactLocation.java │ ├── Exception.java │ └── ReportingDescriptorReference.java ├── .github └── workflows │ ├── validate.yml │ └── publish.yml └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .idea/ 3 | target/ 4 | /.checkstyle 5 | /.classpath 6 | /.project 7 | .settings/ 8 | .vscode/settings.json 9 | .factorypath 10 | /.java-version 11 | Chart.lock 12 | *.tgz 13 | .DS_Store -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | All notable changes to this project will be documented in this file. 3 | 4 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), 5 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). 6 | 7 | ## [2.0.0] - 2021-04-21 8 | ### Changed 9 | - Instead of the serialization library writing all default values in the sarif, 10 | it now relies on the consumer of the sarif to respect the behavior in the sarif 11 | specification to assume the default value for an absent property. 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2020-present Contrast Security 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /src/test/java/com/contrastsecurity/sarif/SerializationTests.java: -------------------------------------------------------------------------------- 1 | package com.contrastsecurity.sarif; 2 | 3 | import com.fasterxml.jackson.core.JsonGenerator; 4 | import com.fasterxml.jackson.databind.JsonNode; 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | import org.junit.jupiter.api.Test; 7 | import static org.assertj.core.api.Assertions.*; 8 | 9 | import java.io.IOException; 10 | import java.io.StringWriter; 11 | 12 | public class SerializationTests { 13 | @Test 14 | void it_serializes_without_junk() throws IOException { 15 | Result result = new Result() 16 | .withMessage(new Message().withText("hi")) 17 | .withLevel(Result.Level.ERROR); 18 | 19 | StringWriter writer = new StringWriter(); 20 | ObjectMapper mapper = new ObjectMapper(); 21 | JsonGenerator generator = mapper.writerWithDefaultPrettyPrinter().createGenerator(writer); 22 | 23 | generator.writeObject(result); 24 | JsonNode actual = new ObjectMapper().readTree(writer.toString()); 25 | JsonNode expected = new ObjectMapper().readTree("{\"level\" : \"error\", \"message\" : { \"text\" : \"hi\" } }"); 26 | 27 | assertThat(actual).isEqualTo(expected); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /.github/workflows/validate.yml: -------------------------------------------------------------------------------- 1 | name: validate 2 | 3 | on: 4 | push: 5 | 6 | jobs: 7 | validate: 8 | if: | 9 | !contains(github.event.head_commit.message, '[maven-release-plugin]') 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v2 13 | - name: Set up JDK 8 14 | uses: actions/setup-java@v1 15 | with: 16 | java-version: 8 17 | server-id: ossrh 18 | server-username: MAVEN_USERNAME 19 | server-password: MAVEN_PASSWORD 20 | gpg-passphrase: GPG_PASSPHRASE 21 | - name: validate 22 | run: mvn clean test 23 | - name: import gpg 24 | run: | 25 | echo ${{secrets.GPG_SECRET_KEYS}} | base64 --decode | gpg --import --no-tty --batch --yes 26 | - name: build 27 | env: 28 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 29 | run: mvn clean install -DskipTests -Prelease 30 | - name: deploy 31 | env: 32 | MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} 33 | MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} 34 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 35 | run: mvn deploy -Prelease -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Content.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | 9 | public enum Content { 10 | 11 | LOCALIZED_DATA("localizedData"), 12 | NON_LOCALIZED_DATA("nonLocalizedData"); 13 | private final String value; 14 | private final static Map CONSTANTS = new HashMap(); 15 | 16 | static { 17 | for (Content c: values()) { 18 | CONSTANTS.put(c.value, c); 19 | } 20 | } 21 | 22 | private Content(String value) { 23 | this.value = value; 24 | } 25 | 26 | @Override 27 | public String toString() { 28 | return this.value; 29 | } 30 | 31 | @JsonValue 32 | public String value() { 33 | return this.value; 34 | } 35 | 36 | @JsonCreator 37 | public static Content fromValue(String value) { 38 | Content constant = CONSTANTS.get(value); 39 | if (constant == null) { 40 | throw new IllegalArgumentException(value); 41 | } else { 42 | return constant; 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Java SARIF 2 | 3 | Contains POJOs generated from the [Static Analysis Results Interchange Format 4 | ](https://docs.oasis-open.org/sarif/sarif/v2.1.0/sarif-v2.1.0.html) (SARIF) 5 | [JSON schema](https://github.com/oasis-tcs/sarif-spec/blob/master/Schemata/sarif-schema-2.1.0.json). 6 | 7 | It uses Jackson for serialising/deserialing from JSON. 8 | 9 | ## Usage 10 | 11 | ### Add as a dependency 12 | 13 | ```xml 14 | 15 | com.contrastsecurity 16 | java-sarif 17 | 2.0 18 | 19 | ``` 20 | 21 | ### Developing with Java SARIF 22 | 23 | All classes reside in the `com.contrastsecurity.sarif` package. The JSON schema used to generate 24 | them is located in `src/main/resources/schema`. 25 | 26 | #### Building Objects 27 | 28 | Building is provided with method chaining, e.g. for Message 29 | 30 | ```java 31 | import com.contrastsecurity.sarif.Message; 32 | // ... 33 | Message message = new Message() 34 | .withText("SQL Injection") 35 | .withMarkdown("# SQL Injection"); 36 | ``` 37 | 38 | Public Getters & Setters are provided. 39 | 40 | #### Jackson 41 | 42 | Classes are decorated with `@JsonInclude(JsonInclude.Include.NON_DEFAULT)` and `@JsonPropertyOrder` 43 | which dictates the order from the JSON schema. 44 | 45 | ```java 46 | import com.fasterxml.jackson.annotation.JsonInclude; 47 | import com.fasterxml.jackson.annotation.JsonProperty; 48 | // ... 49 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 50 | @JsonPropertyOrder({ 51 | "text", 52 | "markdown", 53 | "id", 54 | "arguments", 55 | "properties" 56 | }) 57 | public class Message { 58 | // ... 59 | } 60 | ``` 61 | 62 |
63 |
64 |
65 | 66 | This library uses [jsonschema2pojo](https://github.com/joelittlejohn/jsonschema2pojo) for 67 | generation. 68 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: publish 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | publish: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | - name: Set up JDK 8 12 | uses: actions/setup-java@v1 13 | with: 14 | java-version: 8 15 | server-id: ossrh 16 | server-username: MAVEN_USERNAME 17 | server-password: MAVEN_PASSWORD 18 | gpg-passphrase: GPG_PASSPHRASE 19 | - name: validate 20 | run: mvn clean test 21 | 22 | - name: import gpg 23 | run: | 24 | echo ${{secrets.GPG_SECRET_KEYS}} | base64 --decode | gpg --import --no-tty --batch --yes 25 | - name: build 26 | env: 27 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 28 | run: mvn clean install -DskipTests -Prelease 29 | - name: Maven release (dry-run) 30 | env: 31 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 32 | MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} 33 | MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} 34 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 35 | run: | 36 | mvn -Darguments="-DskipTests=true" -DdryRun=true --batch-mode release:prepare release:perform -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN -Prelease 37 | - name: Maven release 38 | env: 39 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 40 | MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} 41 | MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} 42 | GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} 43 | run: | 44 | git config --global user.name 'Github' 45 | git config --global user.email 'github@users.noreply.github.com' 46 | mvn -Darguments="-DskipTests=true" --batch-mode release:prepare release:perform -Dusername=$GITHUB_ACTOR -Dpassword=$GITHUB_TOKEN -Prelease -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Role.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonCreator; 7 | import com.fasterxml.jackson.annotation.JsonValue; 8 | 9 | public enum Role { 10 | 11 | ANALYSIS_TARGET("analysisTarget"), 12 | ATTACHMENT("attachment"), 13 | RESPONSE_FILE("responseFile"), 14 | RESULT_FILE("resultFile"), 15 | STANDARD_STREAM("standardStream"), 16 | TRACED_FILE("tracedFile"), 17 | UNMODIFIED("unmodified"), 18 | MODIFIED("modified"), 19 | ADDED("added"), 20 | DELETED("deleted"), 21 | RENAMED("renamed"), 22 | UNCONTROLLED("uncontrolled"), 23 | DRIVER("driver"), 24 | EXTENSION("extension"), 25 | TRANSLATION("translation"), 26 | TAXONOMY("taxonomy"), 27 | POLICY("policy"), 28 | REFERENCED_ON_COMMAND_LINE("referencedOnCommandLine"), 29 | MEMORY_CONTENTS("memoryContents"), 30 | DIRECTORY("directory"), 31 | USER_SPECIFIED_CONFIGURATION("userSpecifiedConfiguration"), 32 | TOOL_SPECIFIED_CONFIGURATION("toolSpecifiedConfiguration"), 33 | DEBUG_OUTPUT_FILE("debugOutputFile"); 34 | private final String value; 35 | private final static Map CONSTANTS = new HashMap(); 36 | 37 | static { 38 | for (Role c: values()) { 39 | CONSTANTS.put(c.value, c); 40 | } 41 | } 42 | 43 | private Role(String value) { 44 | this.value = value; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return this.value; 50 | } 51 | 52 | @JsonValue 53 | public String value() { 54 | return this.value; 55 | } 56 | 57 | @JsonCreator 58 | public static Role fromValue(String value) { 59 | Role constant = CONSTANTS.get(value); 60 | if (constant == null) { 61 | throw new IllegalArgumentException(value); 62 | } else { 63 | return constant; 64 | } 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Headers.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * The request headers. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class Headers { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, String value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public Headers withAdditionalProperty(String name, String value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(Headers.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof Headers) == false) { 70 | return false; 71 | } 72 | Headers rhs = ((Headers) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Headers__1.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * The response headers. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class Headers__1 { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, String value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public Headers__1 withAdditionalProperty(String name, String value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(Headers__1 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof Headers__1) == false) { 70 | return false; 71 | } 72 | Headers__1 rhs = ((Headers__1) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Parameters.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * The request parameters. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class Parameters { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, String value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public Parameters withAdditionalProperty(String name, String value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(Parameters.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof Parameters) == false) { 70 | return false; 71 | } 72 | Parameters rhs = ((Parameters) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Fingerprints.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * A set of strings each of which individually defines a stable, unique identity for the result. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class Fingerprints { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, String value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public Fingerprints withAdditionalProperty(String name, String value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(Fingerprints.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof Fingerprints) == false) { 70 | return false; 71 | } 72 | Fingerprints rhs = ((Fingerprints) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Hashes.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * A dictionary, each of whose keys is the name of a hash function and each of whose values is the hashed value of the artifact produced by the specified hash function. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class Hashes { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, String value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public Hashes withAdditionalProperty(String name, String value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(Hashes.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof Hashes) == false) { 70 | return false; 71 | } 72 | Hashes rhs = ((Hashes) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/PartialFingerprints.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * A set of strings that contribute to the stable, unique identity of the result. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class PartialFingerprints { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, String value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public PartialFingerprints withAdditionalProperty(String name, String value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(PartialFingerprints.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof PartialFingerprints) == false) { 70 | return false; 71 | } 72 | PartialFingerprints rhs = ((PartialFingerprints) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/FinalState.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * The values of relevant expressions after the edge has been traversed. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class FinalState { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public FinalState withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(FinalState.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof FinalState) == false) { 70 | return false; 71 | } 72 | FinalState rhs = ((FinalState) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/EnvironmentVariables.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * The environment variables associated with the analysis tool process, expressed as key/value pairs. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class EnvironmentVariables { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, String value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public EnvironmentVariables withAdditionalProperty(String name, String value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(EnvironmentVariables.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof EnvironmentVariables) == false) { 70 | return false; 71 | } 72 | EnvironmentVariables rhs = ((EnvironmentVariables) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ImmutableState.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * Values of relevant expressions at the start of the thread flow that remain constant. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class ImmutableState { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public ImmutableState withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(ImmutableState.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof ImmutableState) == false) { 70 | return false; 71 | } 72 | ImmutableState rhs = ((ImmutableState) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/InitialState.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * Values of relevant expressions at the start of the thread flow that may change during thread flow execution. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class InitialState { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public InitialState withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(InitialState.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof InitialState) == false) { 70 | return false; 71 | } 72 | InitialState rhs = ((InitialState) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/OriginalUriBaseIds.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * The artifact location specified by each uriBaseId symbol on the machine where the tool originally ran. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class OriginalUriBaseIds { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, ArtifactLocation value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public OriginalUriBaseIds withAdditionalProperty(String name, ArtifactLocation value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(OriginalUriBaseIds.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof OriginalUriBaseIds) == false) { 70 | return false; 71 | } 72 | OriginalUriBaseIds rhs = ((OriginalUriBaseIds) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/InitialState__1.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * Values of relevant expressions at the start of the graph traversal that may change during graph traversal. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class InitialState__1 { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public InitialState__1 withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(InitialState__1 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof InitialState__1) == false) { 70 | return false; 71 | } 72 | InitialState__1 rhs = ((InitialState__1) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ImmutableState__1.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * Values of relevant expressions at the start of the graph traversal that remain constant for the graph traversal. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class ImmutableState__1 { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public ImmutableState__1 withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(ImmutableState__1 .class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof ImmutableState__1) == false) { 70 | return false; 71 | } 72 | ImmutableState__1 rhs = ((ImmutableState__1) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/State.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * A dictionary, each of whose keys specifies a variable or expression, the associated value of which represents the variable or expression value. For an annotation of kind 'continuation', for example, this dictionary might hold the current assumed values of a set of global variables. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class State { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public State withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(State.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof State) == false) { 70 | return false; 71 | } 72 | State rhs = ((State) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/MessageStrings.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * A set of name/value pairs with arbitrary names. Each value is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class MessageStrings { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public MessageStrings withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(MessageStrings.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof MessageStrings) == false) { 70 | return false; 71 | } 72 | MessageStrings rhs = ((MessageStrings) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/GlobalMessageStrings.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 7 | import com.fasterxml.jackson.annotation.JsonAnySetter; 8 | import com.fasterxml.jackson.annotation.JsonIgnore; 9 | import com.fasterxml.jackson.annotation.JsonInclude; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | 12 | 13 | /** 14 | * A dictionary, each of whose keys is a resource identifier and each of whose values is a multiformatMessageString object, which holds message strings in plain text and (optionally) Markdown format. The strings can include placeholders, which can be used to construct a message in combination with an arbitrary number of additional string arguments. 15 | * 16 | */ 17 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 18 | @JsonPropertyOrder({ 19 | 20 | }) 21 | public class GlobalMessageStrings { 22 | 23 | @JsonIgnore 24 | private Map additionalProperties = new HashMap(); 25 | 26 | @JsonAnyGetter 27 | public Map getAdditionalProperties() { 28 | return this.additionalProperties; 29 | } 30 | 31 | @JsonAnySetter 32 | public void setAdditionalProperty(String name, MultiformatMessageString value) { 33 | this.additionalProperties.put(name, value); 34 | } 35 | 36 | public GlobalMessageStrings withAdditionalProperty(String name, MultiformatMessageString value) { 37 | this.additionalProperties.put(name, value); 38 | return this; 39 | } 40 | 41 | @Override 42 | public String toString() { 43 | StringBuilder sb = new StringBuilder(); 44 | sb.append(GlobalMessageStrings.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 45 | sb.append("additionalProperties"); 46 | sb.append('='); 47 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 48 | sb.append(','); 49 | if (sb.charAt((sb.length()- 1)) == ',') { 50 | sb.setCharAt((sb.length()- 1), ']'); 51 | } else { 52 | sb.append(']'); 53 | } 54 | return sb.toString(); 55 | } 56 | 57 | @Override 58 | public int hashCode() { 59 | int result = 1; 60 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 61 | return result; 62 | } 63 | 64 | @Override 65 | public boolean equals(Object other) { 66 | if (other == this) { 67 | return true; 68 | } 69 | if ((other instanceof GlobalMessageStrings) == false) { 70 | return false; 71 | } 72 | GlobalMessageStrings rhs = ((GlobalMessageStrings) other); 73 | return ((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/PropertyBag.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | import java.util.Set; 7 | import com.fasterxml.jackson.annotation.JsonAnyGetter; 8 | import com.fasterxml.jackson.annotation.JsonAnySetter; 9 | import com.fasterxml.jackson.annotation.JsonIgnore; 10 | import com.fasterxml.jackson.annotation.JsonInclude; 11 | import com.fasterxml.jackson.annotation.JsonProperty; 12 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 13 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 14 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 15 | 16 | 17 | /** 18 | * Key/value pairs that provide additional information about the object. 19 | * 20 | */ 21 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 22 | @JsonPropertyOrder({ 23 | "tags" 24 | }) 25 | public class PropertyBag { 26 | 27 | /** 28 | * A set of distinct strings that provide additional information. 29 | * 30 | */ 31 | @JsonProperty("tags") 32 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 33 | @JsonPropertyDescription("A set of distinct strings that provide additional information.") 34 | private Set tags = null; 35 | @JsonIgnore 36 | private Map additionalProperties = new HashMap(); 37 | 38 | /** 39 | * A set of distinct strings that provide additional information. 40 | * 41 | */ 42 | @JsonProperty("tags") 43 | public Set getTags() { 44 | return tags; 45 | } 46 | 47 | /** 48 | * A set of distinct strings that provide additional information. 49 | * 50 | */ 51 | @JsonProperty("tags") 52 | public void setTags(Set tags) { 53 | this.tags = tags; 54 | } 55 | 56 | public PropertyBag withTags(Set tags) { 57 | this.tags = tags; 58 | return this; 59 | } 60 | 61 | @JsonAnyGetter 62 | public Map getAdditionalProperties() { 63 | return this.additionalProperties; 64 | } 65 | 66 | @JsonAnySetter 67 | public void setAdditionalProperty(String name, Object value) { 68 | this.additionalProperties.put(name, value); 69 | } 70 | 71 | public PropertyBag withAdditionalProperty(String name, Object value) { 72 | this.additionalProperties.put(name, value); 73 | return this; 74 | } 75 | 76 | @Override 77 | public String toString() { 78 | StringBuilder sb = new StringBuilder(); 79 | sb.append(PropertyBag.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 80 | sb.append("tags"); 81 | sb.append('='); 82 | sb.append(((this.tags == null)?"":this.tags)); 83 | sb.append(','); 84 | sb.append("additionalProperties"); 85 | sb.append('='); 86 | sb.append(((this.additionalProperties == null)?"":this.additionalProperties)); 87 | sb.append(','); 88 | if (sb.charAt((sb.length()- 1)) == ',') { 89 | sb.setCharAt((sb.length()- 1), ']'); 90 | } else { 91 | sb.append(']'); 92 | } 93 | return sb.toString(); 94 | } 95 | 96 | @Override 97 | public int hashCode() { 98 | int result = 1; 99 | result = ((result* 31)+((this.tags == null)? 0 :this.tags.hashCode())); 100 | result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode())); 101 | return result; 102 | } 103 | 104 | @Override 105 | public boolean equals(Object other) { 106 | if (other == this) { 107 | return true; 108 | } 109 | if ((other instanceof PropertyBag) == false) { 110 | return false; 111 | } 112 | PropertyBag rhs = ((PropertyBag) other); 113 | return (((this.tags == rhs.tags)||((this.tags!= null)&&this.tags.equals(rhs.tags)))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties)))); 114 | } 115 | 116 | } 117 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/SpecialLocations.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Defines locations of special significance to SARIF consumers. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "displayBase", 17 | "properties" 18 | }) 19 | public class SpecialLocations { 20 | 21 | /** 22 | * Specifies the location of an artifact. 23 | * 24 | */ 25 | @JsonProperty("displayBase") 26 | @JsonPropertyDescription("Specifies the location of an artifact.") 27 | private ArtifactLocation displayBase; 28 | /** 29 | * Key/value pairs that provide additional information about the object. 30 | * 31 | */ 32 | @JsonProperty("properties") 33 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 34 | private PropertyBag properties; 35 | 36 | /** 37 | * Specifies the location of an artifact. 38 | * 39 | */ 40 | @JsonProperty("displayBase") 41 | public ArtifactLocation getDisplayBase() { 42 | return displayBase; 43 | } 44 | 45 | /** 46 | * Specifies the location of an artifact. 47 | * 48 | */ 49 | @JsonProperty("displayBase") 50 | public void setDisplayBase(ArtifactLocation displayBase) { 51 | this.displayBase = displayBase; 52 | } 53 | 54 | public SpecialLocations withDisplayBase(ArtifactLocation displayBase) { 55 | this.displayBase = displayBase; 56 | return this; 57 | } 58 | 59 | /** 60 | * Key/value pairs that provide additional information about the object. 61 | * 62 | */ 63 | @JsonProperty("properties") 64 | public PropertyBag getProperties() { 65 | return properties; 66 | } 67 | 68 | /** 69 | * Key/value pairs that provide additional information about the object. 70 | * 71 | */ 72 | @JsonProperty("properties") 73 | public void setProperties(PropertyBag properties) { 74 | this.properties = properties; 75 | } 76 | 77 | public SpecialLocations withProperties(PropertyBag properties) { 78 | this.properties = properties; 79 | return this; 80 | } 81 | 82 | @Override 83 | public String toString() { 84 | StringBuilder sb = new StringBuilder(); 85 | sb.append(SpecialLocations.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 86 | sb.append("displayBase"); 87 | sb.append('='); 88 | sb.append(((this.displayBase == null)?"":this.displayBase)); 89 | sb.append(','); 90 | sb.append("properties"); 91 | sb.append('='); 92 | sb.append(((this.properties == null)?"":this.properties)); 93 | sb.append(','); 94 | if (sb.charAt((sb.length()- 1)) == ',') { 95 | sb.setCharAt((sb.length()- 1), ']'); 96 | } else { 97 | sb.append(']'); 98 | } 99 | return sb.toString(); 100 | } 101 | 102 | @Override 103 | public int hashCode() { 104 | int result = 1; 105 | result = ((result* 31)+((this.displayBase == null)? 0 :this.displayBase.hashCode())); 106 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 107 | return result; 108 | } 109 | 110 | @Override 111 | public boolean equals(Object other) { 112 | if (other == this) { 113 | return true; 114 | } 115 | if ((other instanceof SpecialLocations) == false) { 116 | return false; 117 | } 118 | SpecialLocations rhs = ((SpecialLocations) other); 119 | return (((this.displayBase == rhs.displayBase)||((this.displayBase!= null)&&this.displayBase.equals(rhs.displayBase)))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 120 | } 121 | 122 | } 123 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/MultiformatMessageString.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * A message string or message format string rendered in multiple formats. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "text", 17 | "markdown", 18 | "properties" 19 | }) 20 | public class MultiformatMessageString { 21 | 22 | /** 23 | * A plain text message string or format string. 24 | * (Required) 25 | * 26 | */ 27 | @JsonProperty("text") 28 | @JsonPropertyDescription("A plain text message string or format string.") 29 | private String text; 30 | /** 31 | * A Markdown message string or format string. 32 | * 33 | */ 34 | @JsonProperty("markdown") 35 | @JsonPropertyDescription("A Markdown message string or format string.") 36 | private String markdown; 37 | /** 38 | * Key/value pairs that provide additional information about the object. 39 | * 40 | */ 41 | @JsonProperty("properties") 42 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 43 | private PropertyBag properties; 44 | 45 | /** 46 | * A plain text message string or format string. 47 | * (Required) 48 | * 49 | */ 50 | @JsonProperty("text") 51 | public String getText() { 52 | return text; 53 | } 54 | 55 | /** 56 | * A plain text message string or format string. 57 | * (Required) 58 | * 59 | */ 60 | @JsonProperty("text") 61 | public void setText(String text) { 62 | this.text = text; 63 | } 64 | 65 | public MultiformatMessageString withText(String text) { 66 | this.text = text; 67 | return this; 68 | } 69 | 70 | /** 71 | * A Markdown message string or format string. 72 | * 73 | */ 74 | @JsonProperty("markdown") 75 | public String getMarkdown() { 76 | return markdown; 77 | } 78 | 79 | /** 80 | * A Markdown message string or format string. 81 | * 82 | */ 83 | @JsonProperty("markdown") 84 | public void setMarkdown(String markdown) { 85 | this.markdown = markdown; 86 | } 87 | 88 | public MultiformatMessageString withMarkdown(String markdown) { 89 | this.markdown = markdown; 90 | return this; 91 | } 92 | 93 | /** 94 | * Key/value pairs that provide additional information about the object. 95 | * 96 | */ 97 | @JsonProperty("properties") 98 | public PropertyBag getProperties() { 99 | return properties; 100 | } 101 | 102 | /** 103 | * Key/value pairs that provide additional information about the object. 104 | * 105 | */ 106 | @JsonProperty("properties") 107 | public void setProperties(PropertyBag properties) { 108 | this.properties = properties; 109 | } 110 | 111 | public MultiformatMessageString withProperties(PropertyBag properties) { 112 | this.properties = properties; 113 | return this; 114 | } 115 | 116 | @Override 117 | public String toString() { 118 | StringBuilder sb = new StringBuilder(); 119 | sb.append(MultiformatMessageString.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 120 | sb.append("text"); 121 | sb.append('='); 122 | sb.append(((this.text == null)?"":this.text)); 123 | sb.append(','); 124 | sb.append("markdown"); 125 | sb.append('='); 126 | sb.append(((this.markdown == null)?"":this.markdown)); 127 | sb.append(','); 128 | sb.append("properties"); 129 | sb.append('='); 130 | sb.append(((this.properties == null)?"":this.properties)); 131 | sb.append(','); 132 | if (sb.charAt((sb.length()- 1)) == ',') { 133 | sb.setCharAt((sb.length()- 1), ']'); 134 | } else { 135 | sb.append(']'); 136 | } 137 | return sb.toString(); 138 | } 139 | 140 | @Override 141 | public int hashCode() { 142 | int result = 1; 143 | result = ((result* 31)+((this.markdown == null)? 0 :this.markdown.hashCode())); 144 | result = ((result* 31)+((this.text == null)? 0 :this.text.hashCode())); 145 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 146 | return result; 147 | } 148 | 149 | @Override 150 | public boolean equals(Object other) { 151 | if (other == this) { 152 | return true; 153 | } 154 | if ((other instanceof MultiformatMessageString) == false) { 155 | return false; 156 | } 157 | MultiformatMessageString rhs = ((MultiformatMessageString) other); 158 | return ((((this.markdown == rhs.markdown)||((this.markdown!= null)&&this.markdown.equals(rhs.markdown)))&&((this.text == rhs.text)||((this.text!= null)&&this.text.equals(rhs.text))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 159 | } 160 | 161 | } 162 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Stack.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.List; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | 10 | 11 | /** 12 | * A call stack that is relevant to a result. 13 | * 14 | */ 15 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 16 | @JsonPropertyOrder({ 17 | "message", 18 | "frames", 19 | "properties" 20 | }) 21 | public class Stack { 22 | 23 | /** 24 | * Encapsulates a message intended to be read by the end user. 25 | * 26 | */ 27 | @JsonProperty("message") 28 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 29 | private Message message; 30 | /** 31 | * An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. 32 | * (Required) 33 | * 34 | */ 35 | @JsonProperty("frames") 36 | @JsonPropertyDescription("An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack.") 37 | private List frames = null; 38 | /** 39 | * Key/value pairs that provide additional information about the object. 40 | * 41 | */ 42 | @JsonProperty("properties") 43 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 44 | private PropertyBag properties; 45 | 46 | /** 47 | * Encapsulates a message intended to be read by the end user. 48 | * 49 | */ 50 | @JsonProperty("message") 51 | public Message getMessage() { 52 | return message; 53 | } 54 | 55 | /** 56 | * Encapsulates a message intended to be read by the end user. 57 | * 58 | */ 59 | @JsonProperty("message") 60 | public void setMessage(Message message) { 61 | this.message = message; 62 | } 63 | 64 | public Stack withMessage(Message message) { 65 | this.message = message; 66 | return this; 67 | } 68 | 69 | /** 70 | * An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. 71 | * (Required) 72 | * 73 | */ 74 | @JsonProperty("frames") 75 | public List getFrames() { 76 | return frames; 77 | } 78 | 79 | /** 80 | * An array of stack frames that represents a sequence of calls, rendered in reverse chronological order, that comprise the call stack. 81 | * (Required) 82 | * 83 | */ 84 | @JsonProperty("frames") 85 | public void setFrames(List frames) { 86 | this.frames = frames; 87 | } 88 | 89 | public Stack withFrames(List frames) { 90 | this.frames = frames; 91 | return this; 92 | } 93 | 94 | /** 95 | * Key/value pairs that provide additional information about the object. 96 | * 97 | */ 98 | @JsonProperty("properties") 99 | public PropertyBag getProperties() { 100 | return properties; 101 | } 102 | 103 | /** 104 | * Key/value pairs that provide additional information about the object. 105 | * 106 | */ 107 | @JsonProperty("properties") 108 | public void setProperties(PropertyBag properties) { 109 | this.properties = properties; 110 | } 111 | 112 | public Stack withProperties(PropertyBag properties) { 113 | this.properties = properties; 114 | return this; 115 | } 116 | 117 | @Override 118 | public String toString() { 119 | StringBuilder sb = new StringBuilder(); 120 | sb.append(Stack.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 121 | sb.append("message"); 122 | sb.append('='); 123 | sb.append(((this.message == null)?"":this.message)); 124 | sb.append(','); 125 | sb.append("frames"); 126 | sb.append('='); 127 | sb.append(((this.frames == null)?"":this.frames)); 128 | sb.append(','); 129 | sb.append("properties"); 130 | sb.append('='); 131 | sb.append(((this.properties == null)?"":this.properties)); 132 | sb.append(','); 133 | if (sb.charAt((sb.length()- 1)) == ',') { 134 | sb.setCharAt((sb.length()- 1), ']'); 135 | } else { 136 | sb.append(']'); 137 | } 138 | return sb.toString(); 139 | } 140 | 141 | @Override 142 | public int hashCode() { 143 | int result = 1; 144 | result = ((result* 31)+((this.message == null)? 0 :this.message.hashCode())); 145 | result = ((result* 31)+((this.frames == null)? 0 :this.frames.hashCode())); 146 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 147 | return result; 148 | } 149 | 150 | @Override 151 | public boolean equals(Object other) { 152 | if (other == this) { 153 | return true; 154 | } 155 | if ((other instanceof Stack) == false) { 156 | return false; 157 | } 158 | Stack rhs = ((Stack) other); 159 | return ((((this.message == rhs.message)||((this.message!= null)&&this.message.equals(rhs.message)))&&((this.frames == rhs.frames)||((this.frames!= null)&&this.frames.equals(rhs.frames))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 160 | } 161 | 162 | } 163 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Replacement.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * The replacement of a single region of an artifact. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "deletedRegion", 17 | "insertedContent", 18 | "properties" 19 | }) 20 | public class Replacement { 21 | 22 | /** 23 | * A region within an artifact where a result was detected. 24 | * (Required) 25 | * 26 | */ 27 | @JsonProperty("deletedRegion") 28 | @JsonPropertyDescription("A region within an artifact where a result was detected.") 29 | private Region deletedRegion; 30 | /** 31 | * Represents the contents of an artifact. 32 | * 33 | */ 34 | @JsonProperty("insertedContent") 35 | @JsonPropertyDescription("Represents the contents of an artifact.") 36 | private ArtifactContent insertedContent; 37 | /** 38 | * Key/value pairs that provide additional information about the object. 39 | * 40 | */ 41 | @JsonProperty("properties") 42 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 43 | private PropertyBag properties; 44 | 45 | /** 46 | * A region within an artifact where a result was detected. 47 | * (Required) 48 | * 49 | */ 50 | @JsonProperty("deletedRegion") 51 | public Region getDeletedRegion() { 52 | return deletedRegion; 53 | } 54 | 55 | /** 56 | * A region within an artifact where a result was detected. 57 | * (Required) 58 | * 59 | */ 60 | @JsonProperty("deletedRegion") 61 | public void setDeletedRegion(Region deletedRegion) { 62 | this.deletedRegion = deletedRegion; 63 | } 64 | 65 | public Replacement withDeletedRegion(Region deletedRegion) { 66 | this.deletedRegion = deletedRegion; 67 | return this; 68 | } 69 | 70 | /** 71 | * Represents the contents of an artifact. 72 | * 73 | */ 74 | @JsonProperty("insertedContent") 75 | public ArtifactContent getInsertedContent() { 76 | return insertedContent; 77 | } 78 | 79 | /** 80 | * Represents the contents of an artifact. 81 | * 82 | */ 83 | @JsonProperty("insertedContent") 84 | public void setInsertedContent(ArtifactContent insertedContent) { 85 | this.insertedContent = insertedContent; 86 | } 87 | 88 | public Replacement withInsertedContent(ArtifactContent insertedContent) { 89 | this.insertedContent = insertedContent; 90 | return this; 91 | } 92 | 93 | /** 94 | * Key/value pairs that provide additional information about the object. 95 | * 96 | */ 97 | @JsonProperty("properties") 98 | public PropertyBag getProperties() { 99 | return properties; 100 | } 101 | 102 | /** 103 | * Key/value pairs that provide additional information about the object. 104 | * 105 | */ 106 | @JsonProperty("properties") 107 | public void setProperties(PropertyBag properties) { 108 | this.properties = properties; 109 | } 110 | 111 | public Replacement withProperties(PropertyBag properties) { 112 | this.properties = properties; 113 | return this; 114 | } 115 | 116 | @Override 117 | public String toString() { 118 | StringBuilder sb = new StringBuilder(); 119 | sb.append(Replacement.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 120 | sb.append("deletedRegion"); 121 | sb.append('='); 122 | sb.append(((this.deletedRegion == null)?"":this.deletedRegion)); 123 | sb.append(','); 124 | sb.append("insertedContent"); 125 | sb.append('='); 126 | sb.append(((this.insertedContent == null)?"":this.insertedContent)); 127 | sb.append(','); 128 | sb.append("properties"); 129 | sb.append('='); 130 | sb.append(((this.properties == null)?"":this.properties)); 131 | sb.append(','); 132 | if (sb.charAt((sb.length()- 1)) == ',') { 133 | sb.setCharAt((sb.length()- 1), ']'); 134 | } else { 135 | sb.append(']'); 136 | } 137 | return sb.toString(); 138 | } 139 | 140 | @Override 141 | public int hashCode() { 142 | int result = 1; 143 | result = ((result* 31)+((this.insertedContent == null)? 0 :this.insertedContent.hashCode())); 144 | result = ((result* 31)+((this.deletedRegion == null)? 0 :this.deletedRegion.hashCode())); 145 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 146 | return result; 147 | } 148 | 149 | @Override 150 | public boolean equals(Object other) { 151 | if (other == this) { 152 | return true; 153 | } 154 | if ((other instanceof Replacement) == false) { 155 | return false; 156 | } 157 | Replacement rhs = ((Replacement) other); 158 | return ((((this.insertedContent == rhs.insertedContent)||((this.insertedContent!= null)&&this.insertedContent.equals(rhs.insertedContent)))&&((this.deletedRegion == rhs.deletedRegion)||((this.deletedRegion!= null)&&this.deletedRegion.equals(rhs.deletedRegion))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 159 | } 160 | 161 | } 162 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Tool.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.Set; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 10 | 11 | 12 | /** 13 | * The analysis tool that was run. 14 | * 15 | */ 16 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 17 | @JsonPropertyOrder({ 18 | "driver", 19 | "extensions", 20 | "properties" 21 | }) 22 | public class Tool { 23 | 24 | /** 25 | * A component, such as a plug-in or the driver, of the analysis tool that was run. 26 | * (Required) 27 | * 28 | */ 29 | @JsonProperty("driver") 30 | @JsonPropertyDescription("A component, such as a plug-in or the driver, of the analysis tool that was run.") 31 | private ToolComponent driver; 32 | /** 33 | * Tool extensions that contributed to or reconfigured the analysis tool that was run. 34 | * 35 | */ 36 | @JsonProperty("extensions") 37 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 38 | @JsonPropertyDescription("Tool extensions that contributed to or reconfigured the analysis tool that was run.") 39 | private Set extensions = null; 40 | /** 41 | * Key/value pairs that provide additional information about the object. 42 | * 43 | */ 44 | @JsonProperty("properties") 45 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 46 | private PropertyBag properties; 47 | 48 | /** 49 | * A component, such as a plug-in or the driver, of the analysis tool that was run. 50 | * (Required) 51 | * 52 | */ 53 | @JsonProperty("driver") 54 | public ToolComponent getDriver() { 55 | return driver; 56 | } 57 | 58 | /** 59 | * A component, such as a plug-in or the driver, of the analysis tool that was run. 60 | * (Required) 61 | * 62 | */ 63 | @JsonProperty("driver") 64 | public void setDriver(ToolComponent driver) { 65 | this.driver = driver; 66 | } 67 | 68 | public Tool withDriver(ToolComponent driver) { 69 | this.driver = driver; 70 | return this; 71 | } 72 | 73 | /** 74 | * Tool extensions that contributed to or reconfigured the analysis tool that was run. 75 | * 76 | */ 77 | @JsonProperty("extensions") 78 | public Set getExtensions() { 79 | return extensions; 80 | } 81 | 82 | /** 83 | * Tool extensions that contributed to or reconfigured the analysis tool that was run. 84 | * 85 | */ 86 | @JsonProperty("extensions") 87 | public void setExtensions(Set extensions) { 88 | this.extensions = extensions; 89 | } 90 | 91 | public Tool withExtensions(Set extensions) { 92 | this.extensions = extensions; 93 | return this; 94 | } 95 | 96 | /** 97 | * Key/value pairs that provide additional information about the object. 98 | * 99 | */ 100 | @JsonProperty("properties") 101 | public PropertyBag getProperties() { 102 | return properties; 103 | } 104 | 105 | /** 106 | * Key/value pairs that provide additional information about the object. 107 | * 108 | */ 109 | @JsonProperty("properties") 110 | public void setProperties(PropertyBag properties) { 111 | this.properties = properties; 112 | } 113 | 114 | public Tool withProperties(PropertyBag properties) { 115 | this.properties = properties; 116 | return this; 117 | } 118 | 119 | @Override 120 | public String toString() { 121 | StringBuilder sb = new StringBuilder(); 122 | sb.append(Tool.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 123 | sb.append("driver"); 124 | sb.append('='); 125 | sb.append(((this.driver == null)?"":this.driver)); 126 | sb.append(','); 127 | sb.append("extensions"); 128 | sb.append('='); 129 | sb.append(((this.extensions == null)?"":this.extensions)); 130 | sb.append(','); 131 | sb.append("properties"); 132 | sb.append('='); 133 | sb.append(((this.properties == null)?"":this.properties)); 134 | sb.append(','); 135 | if (sb.charAt((sb.length()- 1)) == ',') { 136 | sb.setCharAt((sb.length()- 1), ']'); 137 | } else { 138 | sb.append(']'); 139 | } 140 | return sb.toString(); 141 | } 142 | 143 | @Override 144 | public int hashCode() { 145 | int result = 1; 146 | result = ((result* 31)+((this.extensions == null)? 0 :this.extensions.hashCode())); 147 | result = ((result* 31)+((this.driver == null)? 0 :this.driver.hashCode())); 148 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 149 | return result; 150 | } 151 | 152 | @Override 153 | public boolean equals(Object other) { 154 | if (other == this) { 155 | return true; 156 | } 157 | if ((other instanceof Tool) == false) { 158 | return false; 159 | } 160 | Tool rhs = ((Tool) other); 161 | return ((((this.extensions == rhs.extensions)||((this.extensions!= null)&&this.extensions.equals(rhs.extensions)))&&((this.driver == rhs.driver)||((this.driver!= null)&&this.driver.equals(rhs.driver))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/CodeFlow.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.List; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | 10 | 11 | /** 12 | * A set of threadFlows which together describe a pattern of code execution relevant to detecting a result. 13 | * 14 | */ 15 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 16 | @JsonPropertyOrder({ 17 | "message", 18 | "threadFlows", 19 | "properties" 20 | }) 21 | public class CodeFlow { 22 | 23 | /** 24 | * Encapsulates a message intended to be read by the end user. 25 | * 26 | */ 27 | @JsonProperty("message") 28 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 29 | private Message message; 30 | /** 31 | * An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution. 32 | * (Required) 33 | * 34 | */ 35 | @JsonProperty("threadFlows") 36 | @JsonPropertyDescription("An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution.") 37 | private List threadFlows = null; 38 | /** 39 | * Key/value pairs that provide additional information about the object. 40 | * 41 | */ 42 | @JsonProperty("properties") 43 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 44 | private PropertyBag properties; 45 | 46 | /** 47 | * Encapsulates a message intended to be read by the end user. 48 | * 49 | */ 50 | @JsonProperty("message") 51 | public Message getMessage() { 52 | return message; 53 | } 54 | 55 | /** 56 | * Encapsulates a message intended to be read by the end user. 57 | * 58 | */ 59 | @JsonProperty("message") 60 | public void setMessage(Message message) { 61 | this.message = message; 62 | } 63 | 64 | public CodeFlow withMessage(Message message) { 65 | this.message = message; 66 | return this; 67 | } 68 | 69 | /** 70 | * An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution. 71 | * (Required) 72 | * 73 | */ 74 | @JsonProperty("threadFlows") 75 | public List getThreadFlows() { 76 | return threadFlows; 77 | } 78 | 79 | /** 80 | * An array of one or more unique threadFlow objects, each of which describes the progress of a program through a thread of execution. 81 | * (Required) 82 | * 83 | */ 84 | @JsonProperty("threadFlows") 85 | public void setThreadFlows(List threadFlows) { 86 | this.threadFlows = threadFlows; 87 | } 88 | 89 | public CodeFlow withThreadFlows(List threadFlows) { 90 | this.threadFlows = threadFlows; 91 | return this; 92 | } 93 | 94 | /** 95 | * Key/value pairs that provide additional information about the object. 96 | * 97 | */ 98 | @JsonProperty("properties") 99 | public PropertyBag getProperties() { 100 | return properties; 101 | } 102 | 103 | /** 104 | * Key/value pairs that provide additional information about the object. 105 | * 106 | */ 107 | @JsonProperty("properties") 108 | public void setProperties(PropertyBag properties) { 109 | this.properties = properties; 110 | } 111 | 112 | public CodeFlow withProperties(PropertyBag properties) { 113 | this.properties = properties; 114 | return this; 115 | } 116 | 117 | @Override 118 | public String toString() { 119 | StringBuilder sb = new StringBuilder(); 120 | sb.append(CodeFlow.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 121 | sb.append("message"); 122 | sb.append('='); 123 | sb.append(((this.message == null)?"":this.message)); 124 | sb.append(','); 125 | sb.append("threadFlows"); 126 | sb.append('='); 127 | sb.append(((this.threadFlows == null)?"":this.threadFlows)); 128 | sb.append(','); 129 | sb.append("properties"); 130 | sb.append('='); 131 | sb.append(((this.properties == null)?"":this.properties)); 132 | sb.append(','); 133 | if (sb.charAt((sb.length()- 1)) == ',') { 134 | sb.setCharAt((sb.length()- 1), ']'); 135 | } else { 136 | sb.append(']'); 137 | } 138 | return sb.toString(); 139 | } 140 | 141 | @Override 142 | public int hashCode() { 143 | int result = 1; 144 | result = ((result* 31)+((this.message == null)? 0 :this.message.hashCode())); 145 | result = ((result* 31)+((this.threadFlows == null)? 0 :this.threadFlows.hashCode())); 146 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 147 | return result; 148 | } 149 | 150 | @Override 151 | public boolean equals(Object other) { 152 | if (other == this) { 153 | return true; 154 | } 155 | if ((other instanceof CodeFlow) == false) { 156 | return false; 157 | } 158 | CodeFlow rhs = ((CodeFlow) other); 159 | return ((((this.message == rhs.message)||((this.message!= null)&&this.message.equals(rhs.message)))&&((this.threadFlows == rhs.threadFlows)||((this.threadFlows!= null)&&this.threadFlows.equals(rhs.threadFlows))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 160 | } 161 | 162 | } 163 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Fix.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.Set; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 10 | 11 | 12 | /** 13 | * A proposed fix for the problem represented by a result object. A fix specifies a set of artifacts to modify. For each artifact, it specifies a set of bytes to remove, and provides a set of new bytes to replace them. 14 | * 15 | */ 16 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 17 | @JsonPropertyOrder({ 18 | "description", 19 | "artifactChanges", 20 | "properties" 21 | }) 22 | public class Fix { 23 | 24 | /** 25 | * Encapsulates a message intended to be read by the end user. 26 | * 27 | */ 28 | @JsonProperty("description") 29 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 30 | private Message description; 31 | /** 32 | * One or more artifact changes that comprise a fix for a result. 33 | * (Required) 34 | * 35 | */ 36 | @JsonProperty("artifactChanges") 37 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 38 | @JsonPropertyDescription("One or more artifact changes that comprise a fix for a result.") 39 | private Set artifactChanges = null; 40 | /** 41 | * Key/value pairs that provide additional information about the object. 42 | * 43 | */ 44 | @JsonProperty("properties") 45 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 46 | private PropertyBag properties; 47 | 48 | /** 49 | * Encapsulates a message intended to be read by the end user. 50 | * 51 | */ 52 | @JsonProperty("description") 53 | public Message getDescription() { 54 | return description; 55 | } 56 | 57 | /** 58 | * Encapsulates a message intended to be read by the end user. 59 | * 60 | */ 61 | @JsonProperty("description") 62 | public void setDescription(Message description) { 63 | this.description = description; 64 | } 65 | 66 | public Fix withDescription(Message description) { 67 | this.description = description; 68 | return this; 69 | } 70 | 71 | /** 72 | * One or more artifact changes that comprise a fix for a result. 73 | * (Required) 74 | * 75 | */ 76 | @JsonProperty("artifactChanges") 77 | public Set getArtifactChanges() { 78 | return artifactChanges; 79 | } 80 | 81 | /** 82 | * One or more artifact changes that comprise a fix for a result. 83 | * (Required) 84 | * 85 | */ 86 | @JsonProperty("artifactChanges") 87 | public void setArtifactChanges(Set artifactChanges) { 88 | this.artifactChanges = artifactChanges; 89 | } 90 | 91 | public Fix withArtifactChanges(Set artifactChanges) { 92 | this.artifactChanges = artifactChanges; 93 | return this; 94 | } 95 | 96 | /** 97 | * Key/value pairs that provide additional information about the object. 98 | * 99 | */ 100 | @JsonProperty("properties") 101 | public PropertyBag getProperties() { 102 | return properties; 103 | } 104 | 105 | /** 106 | * Key/value pairs that provide additional information about the object. 107 | * 108 | */ 109 | @JsonProperty("properties") 110 | public void setProperties(PropertyBag properties) { 111 | this.properties = properties; 112 | } 113 | 114 | public Fix withProperties(PropertyBag properties) { 115 | this.properties = properties; 116 | return this; 117 | } 118 | 119 | @Override 120 | public String toString() { 121 | StringBuilder sb = new StringBuilder(); 122 | sb.append(Fix.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 123 | sb.append("description"); 124 | sb.append('='); 125 | sb.append(((this.description == null)?"":this.description)); 126 | sb.append(','); 127 | sb.append("artifactChanges"); 128 | sb.append('='); 129 | sb.append(((this.artifactChanges == null)?"":this.artifactChanges)); 130 | sb.append(','); 131 | sb.append("properties"); 132 | sb.append('='); 133 | sb.append(((this.properties == null)?"":this.properties)); 134 | sb.append(','); 135 | if (sb.charAt((sb.length()- 1)) == ',') { 136 | sb.setCharAt((sb.length()- 1), ']'); 137 | } else { 138 | sb.append(']'); 139 | } 140 | return sb.toString(); 141 | } 142 | 143 | @Override 144 | public int hashCode() { 145 | int result = 1; 146 | result = ((result* 31)+((this.artifactChanges == null)? 0 :this.artifactChanges.hashCode())); 147 | result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); 148 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 149 | return result; 150 | } 151 | 152 | @Override 153 | public boolean equals(Object other) { 154 | if (other == this) { 155 | return true; 156 | } 157 | if ((other instanceof Fix) == false) { 158 | return false; 159 | } 160 | Fix rhs = ((Fix) other); 161 | return ((((this.artifactChanges == rhs.artifactChanges)||((this.artifactChanges!= null)&&this.artifactChanges.equals(rhs.artifactChanges)))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ConfigurationOverride.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Information about how a specific rule or notification was reconfigured at runtime. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "configuration", 17 | "descriptor", 18 | "properties" 19 | }) 20 | public class ConfigurationOverride { 21 | 22 | /** 23 | * Information about a rule or notification that can be configured at runtime. 24 | * (Required) 25 | * 26 | */ 27 | @JsonProperty("configuration") 28 | @JsonPropertyDescription("Information about a rule or notification that can be configured at runtime.") 29 | private ReportingConfiguration configuration; 30 | /** 31 | * Information about how to locate a relevant reporting descriptor. 32 | * (Required) 33 | * 34 | */ 35 | @JsonProperty("descriptor") 36 | @JsonPropertyDescription("Information about how to locate a relevant reporting descriptor.") 37 | private ReportingDescriptorReference descriptor; 38 | /** 39 | * Key/value pairs that provide additional information about the object. 40 | * 41 | */ 42 | @JsonProperty("properties") 43 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 44 | private PropertyBag properties; 45 | 46 | /** 47 | * Information about a rule or notification that can be configured at runtime. 48 | * (Required) 49 | * 50 | */ 51 | @JsonProperty("configuration") 52 | public ReportingConfiguration getConfiguration() { 53 | return configuration; 54 | } 55 | 56 | /** 57 | * Information about a rule or notification that can be configured at runtime. 58 | * (Required) 59 | * 60 | */ 61 | @JsonProperty("configuration") 62 | public void setConfiguration(ReportingConfiguration configuration) { 63 | this.configuration = configuration; 64 | } 65 | 66 | public ConfigurationOverride withConfiguration(ReportingConfiguration configuration) { 67 | this.configuration = configuration; 68 | return this; 69 | } 70 | 71 | /** 72 | * Information about how to locate a relevant reporting descriptor. 73 | * (Required) 74 | * 75 | */ 76 | @JsonProperty("descriptor") 77 | public ReportingDescriptorReference getDescriptor() { 78 | return descriptor; 79 | } 80 | 81 | /** 82 | * Information about how to locate a relevant reporting descriptor. 83 | * (Required) 84 | * 85 | */ 86 | @JsonProperty("descriptor") 87 | public void setDescriptor(ReportingDescriptorReference descriptor) { 88 | this.descriptor = descriptor; 89 | } 90 | 91 | public ConfigurationOverride withDescriptor(ReportingDescriptorReference descriptor) { 92 | this.descriptor = descriptor; 93 | return this; 94 | } 95 | 96 | /** 97 | * Key/value pairs that provide additional information about the object. 98 | * 99 | */ 100 | @JsonProperty("properties") 101 | public PropertyBag getProperties() { 102 | return properties; 103 | } 104 | 105 | /** 106 | * Key/value pairs that provide additional information about the object. 107 | * 108 | */ 109 | @JsonProperty("properties") 110 | public void setProperties(PropertyBag properties) { 111 | this.properties = properties; 112 | } 113 | 114 | public ConfigurationOverride withProperties(PropertyBag properties) { 115 | this.properties = properties; 116 | return this; 117 | } 118 | 119 | @Override 120 | public String toString() { 121 | StringBuilder sb = new StringBuilder(); 122 | sb.append(ConfigurationOverride.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 123 | sb.append("configuration"); 124 | sb.append('='); 125 | sb.append(((this.configuration == null)?"":this.configuration)); 126 | sb.append(','); 127 | sb.append("descriptor"); 128 | sb.append('='); 129 | sb.append(((this.descriptor == null)?"":this.descriptor)); 130 | sb.append(','); 131 | sb.append("properties"); 132 | sb.append('='); 133 | sb.append(((this.properties == null)?"":this.properties)); 134 | sb.append(','); 135 | if (sb.charAt((sb.length()- 1)) == ',') { 136 | sb.setCharAt((sb.length()- 1), ']'); 137 | } else { 138 | sb.append(']'); 139 | } 140 | return sb.toString(); 141 | } 142 | 143 | @Override 144 | public int hashCode() { 145 | int result = 1; 146 | result = ((result* 31)+((this.descriptor == null)? 0 :this.descriptor.hashCode())); 147 | result = ((result* 31)+((this.configuration == null)? 0 :this.configuration.hashCode())); 148 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 149 | return result; 150 | } 151 | 152 | @Override 153 | public boolean equals(Object other) { 154 | if (other == this) { 155 | return true; 156 | } 157 | if ((other instanceof ConfigurationOverride) == false) { 158 | return false; 159 | } 160 | ConfigurationOverride rhs = ((ConfigurationOverride) other); 161 | return ((((this.descriptor == rhs.descriptor)||((this.descriptor!= null)&&this.descriptor.equals(rhs.descriptor)))&&((this.configuration == rhs.configuration)||((this.configuration!= null)&&this.configuration.equals(rhs.configuration))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 162 | } 163 | 164 | } 165 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ArtifactChange.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.List; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | 10 | 11 | /** 12 | * A change to a single artifact. 13 | * 14 | */ 15 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 16 | @JsonPropertyOrder({ 17 | "artifactLocation", 18 | "replacements", 19 | "properties" 20 | }) 21 | public class ArtifactChange { 22 | 23 | /** 24 | * Specifies the location of an artifact. 25 | * (Required) 26 | * 27 | */ 28 | @JsonProperty("artifactLocation") 29 | @JsonPropertyDescription("Specifies the location of an artifact.") 30 | private ArtifactLocation artifactLocation; 31 | /** 32 | * An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'. 33 | * (Required) 34 | * 35 | */ 36 | @JsonProperty("replacements") 37 | @JsonPropertyDescription("An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'.") 38 | private List replacements = null; 39 | /** 40 | * Key/value pairs that provide additional information about the object. 41 | * 42 | */ 43 | @JsonProperty("properties") 44 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 45 | private PropertyBag properties; 46 | 47 | /** 48 | * Specifies the location of an artifact. 49 | * (Required) 50 | * 51 | */ 52 | @JsonProperty("artifactLocation") 53 | public ArtifactLocation getArtifactLocation() { 54 | return artifactLocation; 55 | } 56 | 57 | /** 58 | * Specifies the location of an artifact. 59 | * (Required) 60 | * 61 | */ 62 | @JsonProperty("artifactLocation") 63 | public void setArtifactLocation(ArtifactLocation artifactLocation) { 64 | this.artifactLocation = artifactLocation; 65 | } 66 | 67 | public ArtifactChange withArtifactLocation(ArtifactLocation artifactLocation) { 68 | this.artifactLocation = artifactLocation; 69 | return this; 70 | } 71 | 72 | /** 73 | * An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'. 74 | * (Required) 75 | * 76 | */ 77 | @JsonProperty("replacements") 78 | public List getReplacements() { 79 | return replacements; 80 | } 81 | 82 | /** 83 | * An array of replacement objects, each of which represents the replacement of a single region in a single artifact specified by 'artifactLocation'. 84 | * (Required) 85 | * 86 | */ 87 | @JsonProperty("replacements") 88 | public void setReplacements(List replacements) { 89 | this.replacements = replacements; 90 | } 91 | 92 | public ArtifactChange withReplacements(List replacements) { 93 | this.replacements = replacements; 94 | return this; 95 | } 96 | 97 | /** 98 | * Key/value pairs that provide additional information about the object. 99 | * 100 | */ 101 | @JsonProperty("properties") 102 | public PropertyBag getProperties() { 103 | return properties; 104 | } 105 | 106 | /** 107 | * Key/value pairs that provide additional information about the object. 108 | * 109 | */ 110 | @JsonProperty("properties") 111 | public void setProperties(PropertyBag properties) { 112 | this.properties = properties; 113 | } 114 | 115 | public ArtifactChange withProperties(PropertyBag properties) { 116 | this.properties = properties; 117 | return this; 118 | } 119 | 120 | @Override 121 | public String toString() { 122 | StringBuilder sb = new StringBuilder(); 123 | sb.append(ArtifactChange.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 124 | sb.append("artifactLocation"); 125 | sb.append('='); 126 | sb.append(((this.artifactLocation == null)?"":this.artifactLocation)); 127 | sb.append(','); 128 | sb.append("replacements"); 129 | sb.append('='); 130 | sb.append(((this.replacements == null)?"":this.replacements)); 131 | sb.append(','); 132 | sb.append("properties"); 133 | sb.append('='); 134 | sb.append(((this.properties == null)?"":this.properties)); 135 | sb.append(','); 136 | if (sb.charAt((sb.length()- 1)) == ',') { 137 | sb.setCharAt((sb.length()- 1), ']'); 138 | } else { 139 | sb.append(']'); 140 | } 141 | return sb.toString(); 142 | } 143 | 144 | @Override 145 | public int hashCode() { 146 | int result = 1; 147 | result = ((result* 31)+((this.replacements == null)? 0 :this.replacements.hashCode())); 148 | result = ((result* 31)+((this.artifactLocation == null)? 0 :this.artifactLocation.hashCode())); 149 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 150 | return result; 151 | } 152 | 153 | @Override 154 | public boolean equals(Object other) { 155 | if (other == this) { 156 | return true; 157 | } 158 | if ((other instanceof ArtifactChange) == false) { 159 | return false; 160 | } 161 | ArtifactChange rhs = ((ArtifactChange) other); 162 | return ((((this.replacements == rhs.replacements)||((this.replacements!= null)&&this.replacements.equals(rhs.replacements)))&&((this.artifactLocation == rhs.artifactLocation)||((this.artifactLocation!= null)&&this.artifactLocation.equals(rhs.artifactLocation))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 163 | } 164 | 165 | } 166 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ToolComponentReference.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Identifies a particular toolComponent object, either the driver or an extension. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "name", 17 | "index", 18 | "guid", 19 | "properties" 20 | }) 21 | public class ToolComponentReference { 22 | 23 | /** 24 | * The 'name' property of the referenced toolComponent. 25 | * 26 | */ 27 | @JsonProperty("name") 28 | @JsonPropertyDescription("The 'name' property of the referenced toolComponent.") 29 | private String name; 30 | /** 31 | * An index into the referenced toolComponent in tool.extensions. 32 | * 33 | */ 34 | @JsonProperty("index") 35 | @JsonPropertyDescription("An index into the referenced toolComponent in tool.extensions.") 36 | private Integer index = -1; 37 | /** 38 | * The 'guid' property of the referenced toolComponent. 39 | * 40 | */ 41 | @JsonProperty("guid") 42 | @JsonPropertyDescription("The 'guid' property of the referenced toolComponent.") 43 | private String guid; 44 | /** 45 | * Key/value pairs that provide additional information about the object. 46 | * 47 | */ 48 | @JsonProperty("properties") 49 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 50 | private PropertyBag properties; 51 | 52 | /** 53 | * The 'name' property of the referenced toolComponent. 54 | * 55 | */ 56 | @JsonProperty("name") 57 | public String getName() { 58 | return name; 59 | } 60 | 61 | /** 62 | * The 'name' property of the referenced toolComponent. 63 | * 64 | */ 65 | @JsonProperty("name") 66 | public void setName(String name) { 67 | this.name = name; 68 | } 69 | 70 | public ToolComponentReference withName(String name) { 71 | this.name = name; 72 | return this; 73 | } 74 | 75 | /** 76 | * An index into the referenced toolComponent in tool.extensions. 77 | * 78 | */ 79 | @JsonProperty("index") 80 | public Integer getIndex() { 81 | return index; 82 | } 83 | 84 | /** 85 | * An index into the referenced toolComponent in tool.extensions. 86 | * 87 | */ 88 | @JsonProperty("index") 89 | public void setIndex(Integer index) { 90 | this.index = index; 91 | } 92 | 93 | public ToolComponentReference withIndex(Integer index) { 94 | this.index = index; 95 | return this; 96 | } 97 | 98 | /** 99 | * The 'guid' property of the referenced toolComponent. 100 | * 101 | */ 102 | @JsonProperty("guid") 103 | public String getGuid() { 104 | return guid; 105 | } 106 | 107 | /** 108 | * The 'guid' property of the referenced toolComponent. 109 | * 110 | */ 111 | @JsonProperty("guid") 112 | public void setGuid(String guid) { 113 | this.guid = guid; 114 | } 115 | 116 | public ToolComponentReference withGuid(String guid) { 117 | this.guid = guid; 118 | return this; 119 | } 120 | 121 | /** 122 | * Key/value pairs that provide additional information about the object. 123 | * 124 | */ 125 | @JsonProperty("properties") 126 | public PropertyBag getProperties() { 127 | return properties; 128 | } 129 | 130 | /** 131 | * Key/value pairs that provide additional information about the object. 132 | * 133 | */ 134 | @JsonProperty("properties") 135 | public void setProperties(PropertyBag properties) { 136 | this.properties = properties; 137 | } 138 | 139 | public ToolComponentReference withProperties(PropertyBag properties) { 140 | this.properties = properties; 141 | return this; 142 | } 143 | 144 | @Override 145 | public String toString() { 146 | StringBuilder sb = new StringBuilder(); 147 | sb.append(ToolComponentReference.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 148 | sb.append("name"); 149 | sb.append('='); 150 | sb.append(((this.name == null)?"":this.name)); 151 | sb.append(','); 152 | sb.append("index"); 153 | sb.append('='); 154 | sb.append(((this.index == null)?"":this.index)); 155 | sb.append(','); 156 | sb.append("guid"); 157 | sb.append('='); 158 | sb.append(((this.guid == null)?"":this.guid)); 159 | sb.append(','); 160 | sb.append("properties"); 161 | sb.append('='); 162 | sb.append(((this.properties == null)?"":this.properties)); 163 | sb.append(','); 164 | if (sb.charAt((sb.length()- 1)) == ',') { 165 | sb.setCharAt((sb.length()- 1), ']'); 166 | } else { 167 | sb.append(']'); 168 | } 169 | return sb.toString(); 170 | } 171 | 172 | @Override 173 | public int hashCode() { 174 | int result = 1; 175 | result = ((result* 31)+((this.name == null)? 0 :this.name.hashCode())); 176 | result = ((result* 31)+((this.index == null)? 0 :this.index.hashCode())); 177 | result = ((result* 31)+((this.guid == null)? 0 :this.guid.hashCode())); 178 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 179 | return result; 180 | } 181 | 182 | @Override 183 | public boolean equals(Object other) { 184 | if (other == this) { 185 | return true; 186 | } 187 | if ((other instanceof ToolComponentReference) == false) { 188 | return false; 189 | } 190 | ToolComponentReference rhs = ((ToolComponentReference) other); 191 | return (((((this.name == rhs.name)||((this.name!= null)&&this.name.equals(rhs.name)))&&((this.index == rhs.index)||((this.index!= null)&&this.index.equals(rhs.index))))&&((this.guid == rhs.guid)||((this.guid!= null)&&this.guid.equals(rhs.guid))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 192 | } 193 | 194 | } 195 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ArtifactContent.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Represents the contents of an artifact. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "text", 17 | "binary", 18 | "rendered", 19 | "properties" 20 | }) 21 | public class ArtifactContent { 22 | 23 | /** 24 | * UTF-8-encoded content from a text artifact. 25 | * 26 | */ 27 | @JsonProperty("text") 28 | @JsonPropertyDescription("UTF-8-encoded content from a text artifact.") 29 | private String text; 30 | /** 31 | * MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. 32 | * 33 | */ 34 | @JsonProperty("binary") 35 | @JsonPropertyDescription("MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding.") 36 | private String binary; 37 | /** 38 | * A message string or message format string rendered in multiple formats. 39 | * 40 | */ 41 | @JsonProperty("rendered") 42 | @JsonPropertyDescription("A message string or message format string rendered in multiple formats.") 43 | private MultiformatMessageString rendered; 44 | /** 45 | * Key/value pairs that provide additional information about the object. 46 | * 47 | */ 48 | @JsonProperty("properties") 49 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 50 | private PropertyBag properties; 51 | 52 | /** 53 | * UTF-8-encoded content from a text artifact. 54 | * 55 | */ 56 | @JsonProperty("text") 57 | public String getText() { 58 | return text; 59 | } 60 | 61 | /** 62 | * UTF-8-encoded content from a text artifact. 63 | * 64 | */ 65 | @JsonProperty("text") 66 | public void setText(String text) { 67 | this.text = text; 68 | } 69 | 70 | public ArtifactContent withText(String text) { 71 | this.text = text; 72 | return this; 73 | } 74 | 75 | /** 76 | * MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. 77 | * 78 | */ 79 | @JsonProperty("binary") 80 | public String getBinary() { 81 | return binary; 82 | } 83 | 84 | /** 85 | * MIME Base64-encoded content from a binary artifact, or from a text artifact in its original encoding. 86 | * 87 | */ 88 | @JsonProperty("binary") 89 | public void setBinary(String binary) { 90 | this.binary = binary; 91 | } 92 | 93 | public ArtifactContent withBinary(String binary) { 94 | this.binary = binary; 95 | return this; 96 | } 97 | 98 | /** 99 | * A message string or message format string rendered in multiple formats. 100 | * 101 | */ 102 | @JsonProperty("rendered") 103 | public MultiformatMessageString getRendered() { 104 | return rendered; 105 | } 106 | 107 | /** 108 | * A message string or message format string rendered in multiple formats. 109 | * 110 | */ 111 | @JsonProperty("rendered") 112 | public void setRendered(MultiformatMessageString rendered) { 113 | this.rendered = rendered; 114 | } 115 | 116 | public ArtifactContent withRendered(MultiformatMessageString rendered) { 117 | this.rendered = rendered; 118 | return this; 119 | } 120 | 121 | /** 122 | * Key/value pairs that provide additional information about the object. 123 | * 124 | */ 125 | @JsonProperty("properties") 126 | public PropertyBag getProperties() { 127 | return properties; 128 | } 129 | 130 | /** 131 | * Key/value pairs that provide additional information about the object. 132 | * 133 | */ 134 | @JsonProperty("properties") 135 | public void setProperties(PropertyBag properties) { 136 | this.properties = properties; 137 | } 138 | 139 | public ArtifactContent withProperties(PropertyBag properties) { 140 | this.properties = properties; 141 | return this; 142 | } 143 | 144 | @Override 145 | public String toString() { 146 | StringBuilder sb = new StringBuilder(); 147 | sb.append(ArtifactContent.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 148 | sb.append("text"); 149 | sb.append('='); 150 | sb.append(((this.text == null)?"":this.text)); 151 | sb.append(','); 152 | sb.append("binary"); 153 | sb.append('='); 154 | sb.append(((this.binary == null)?"":this.binary)); 155 | sb.append(','); 156 | sb.append("rendered"); 157 | sb.append('='); 158 | sb.append(((this.rendered == null)?"":this.rendered)); 159 | sb.append(','); 160 | sb.append("properties"); 161 | sb.append('='); 162 | sb.append(((this.properties == null)?"":this.properties)); 163 | sb.append(','); 164 | if (sb.charAt((sb.length()- 1)) == ',') { 165 | sb.setCharAt((sb.length()- 1), ']'); 166 | } else { 167 | sb.append(']'); 168 | } 169 | return sb.toString(); 170 | } 171 | 172 | @Override 173 | public int hashCode() { 174 | int result = 1; 175 | result = ((result* 31)+((this.text == null)? 0 :this.text.hashCode())); 176 | result = ((result* 31)+((this.rendered == null)? 0 :this.rendered.hashCode())); 177 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 178 | result = ((result* 31)+((this.binary == null)? 0 :this.binary.hashCode())); 179 | return result; 180 | } 181 | 182 | @Override 183 | public boolean equals(Object other) { 184 | if (other == this) { 185 | return true; 186 | } 187 | if ((other instanceof ArtifactContent) == false) { 188 | return false; 189 | } 190 | ArtifactContent rhs = ((ArtifactContent) other); 191 | return (((((this.text == rhs.text)||((this.text!= null)&&this.text.equals(rhs.text)))&&((this.rendered == rhs.rendered)||((this.rendered!= null)&&this.rendered.equals(rhs.rendered))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.binary == rhs.binary)||((this.binary!= null)&&this.binary.equals(rhs.binary)))); 192 | } 193 | 194 | } 195 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Graph.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.Set; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 10 | 11 | 12 | /** 13 | * A network of nodes and directed edges that describes some aspect of the structure of the code (for example, a call graph). 14 | * 15 | */ 16 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 17 | @JsonPropertyOrder({ 18 | "description", 19 | "nodes", 20 | "edges", 21 | "properties" 22 | }) 23 | public class Graph { 24 | 25 | /** 26 | * Encapsulates a message intended to be read by the end user. 27 | * 28 | */ 29 | @JsonProperty("description") 30 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 31 | private Message description; 32 | /** 33 | * An array of node objects representing the nodes of the graph. 34 | * 35 | */ 36 | @JsonProperty("nodes") 37 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 38 | @JsonPropertyDescription("An array of node objects representing the nodes of the graph.") 39 | private Set nodes = null; 40 | /** 41 | * An array of edge objects representing the edges of the graph. 42 | * 43 | */ 44 | @JsonProperty("edges") 45 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 46 | @JsonPropertyDescription("An array of edge objects representing the edges of the graph.") 47 | private Set edges = null; 48 | /** 49 | * Key/value pairs that provide additional information about the object. 50 | * 51 | */ 52 | @JsonProperty("properties") 53 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 54 | private PropertyBag properties; 55 | 56 | /** 57 | * Encapsulates a message intended to be read by the end user. 58 | * 59 | */ 60 | @JsonProperty("description") 61 | public Message getDescription() { 62 | return description; 63 | } 64 | 65 | /** 66 | * Encapsulates a message intended to be read by the end user. 67 | * 68 | */ 69 | @JsonProperty("description") 70 | public void setDescription(Message description) { 71 | this.description = description; 72 | } 73 | 74 | public Graph withDescription(Message description) { 75 | this.description = description; 76 | return this; 77 | } 78 | 79 | /** 80 | * An array of node objects representing the nodes of the graph. 81 | * 82 | */ 83 | @JsonProperty("nodes") 84 | public Set getNodes() { 85 | return nodes; 86 | } 87 | 88 | /** 89 | * An array of node objects representing the nodes of the graph. 90 | * 91 | */ 92 | @JsonProperty("nodes") 93 | public void setNodes(Set nodes) { 94 | this.nodes = nodes; 95 | } 96 | 97 | public Graph withNodes(Set nodes) { 98 | this.nodes = nodes; 99 | return this; 100 | } 101 | 102 | /** 103 | * An array of edge objects representing the edges of the graph. 104 | * 105 | */ 106 | @JsonProperty("edges") 107 | public Set getEdges() { 108 | return edges; 109 | } 110 | 111 | /** 112 | * An array of edge objects representing the edges of the graph. 113 | * 114 | */ 115 | @JsonProperty("edges") 116 | public void setEdges(Set edges) { 117 | this.edges = edges; 118 | } 119 | 120 | public Graph withEdges(Set edges) { 121 | this.edges = edges; 122 | return this; 123 | } 124 | 125 | /** 126 | * Key/value pairs that provide additional information about the object. 127 | * 128 | */ 129 | @JsonProperty("properties") 130 | public PropertyBag getProperties() { 131 | return properties; 132 | } 133 | 134 | /** 135 | * Key/value pairs that provide additional information about the object. 136 | * 137 | */ 138 | @JsonProperty("properties") 139 | public void setProperties(PropertyBag properties) { 140 | this.properties = properties; 141 | } 142 | 143 | public Graph withProperties(PropertyBag properties) { 144 | this.properties = properties; 145 | return this; 146 | } 147 | 148 | @Override 149 | public String toString() { 150 | StringBuilder sb = new StringBuilder(); 151 | sb.append(Graph.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 152 | sb.append("description"); 153 | sb.append('='); 154 | sb.append(((this.description == null)?"":this.description)); 155 | sb.append(','); 156 | sb.append("nodes"); 157 | sb.append('='); 158 | sb.append(((this.nodes == null)?"":this.nodes)); 159 | sb.append(','); 160 | sb.append("edges"); 161 | sb.append('='); 162 | sb.append(((this.edges == null)?"":this.edges)); 163 | sb.append(','); 164 | sb.append("properties"); 165 | sb.append('='); 166 | sb.append(((this.properties == null)?"":this.properties)); 167 | sb.append(','); 168 | if (sb.charAt((sb.length()- 1)) == ',') { 169 | sb.setCharAt((sb.length()- 1), ']'); 170 | } else { 171 | sb.append(']'); 172 | } 173 | return sb.toString(); 174 | } 175 | 176 | @Override 177 | public int hashCode() { 178 | int result = 1; 179 | result = ((result* 31)+((this.edges == null)? 0 :this.edges.hashCode())); 180 | result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); 181 | result = ((result* 31)+((this.nodes == null)? 0 :this.nodes.hashCode())); 182 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 183 | return result; 184 | } 185 | 186 | @Override 187 | public boolean equals(Object other) { 188 | if (other == this) { 189 | return true; 190 | } 191 | if ((other instanceof Graph) == false) { 192 | return false; 193 | } 194 | Graph rhs = ((Graph) other); 195 | return (((((this.edges == rhs.edges)||((this.edges!= null)&&this.edges.equals(rhs.edges)))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.nodes == rhs.nodes)||((this.nodes!= null)&&this.nodes.equals(rhs.nodes))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 196 | } 197 | 198 | } 199 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ExternalPropertyFileReference.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Contains information that enables a SARIF consumer to locate the external property file that contains the value of an externalized property associated with the run. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "location", 17 | "guid", 18 | "itemCount", 19 | "properties" 20 | }) 21 | public class ExternalPropertyFileReference { 22 | 23 | /** 24 | * Specifies the location of an artifact. 25 | * 26 | */ 27 | @JsonProperty("location") 28 | @JsonPropertyDescription("Specifies the location of an artifact.") 29 | private ArtifactLocation location; 30 | /** 31 | * A stable, unique identifer for the external property file in the form of a GUID. 32 | * 33 | */ 34 | @JsonProperty("guid") 35 | @JsonPropertyDescription("A stable, unique identifer for the external property file in the form of a GUID.") 36 | private String guid; 37 | /** 38 | * A non-negative integer specifying the number of items contained in the external property file. 39 | * 40 | */ 41 | @JsonProperty("itemCount") 42 | @JsonPropertyDescription("A non-negative integer specifying the number of items contained in the external property file.") 43 | private Integer itemCount = -1; 44 | /** 45 | * Key/value pairs that provide additional information about the object. 46 | * 47 | */ 48 | @JsonProperty("properties") 49 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 50 | private PropertyBag properties; 51 | 52 | /** 53 | * Specifies the location of an artifact. 54 | * 55 | */ 56 | @JsonProperty("location") 57 | public ArtifactLocation getLocation() { 58 | return location; 59 | } 60 | 61 | /** 62 | * Specifies the location of an artifact. 63 | * 64 | */ 65 | @JsonProperty("location") 66 | public void setLocation(ArtifactLocation location) { 67 | this.location = location; 68 | } 69 | 70 | public ExternalPropertyFileReference withLocation(ArtifactLocation location) { 71 | this.location = location; 72 | return this; 73 | } 74 | 75 | /** 76 | * A stable, unique identifer for the external property file in the form of a GUID. 77 | * 78 | */ 79 | @JsonProperty("guid") 80 | public String getGuid() { 81 | return guid; 82 | } 83 | 84 | /** 85 | * A stable, unique identifer for the external property file in the form of a GUID. 86 | * 87 | */ 88 | @JsonProperty("guid") 89 | public void setGuid(String guid) { 90 | this.guid = guid; 91 | } 92 | 93 | public ExternalPropertyFileReference withGuid(String guid) { 94 | this.guid = guid; 95 | return this; 96 | } 97 | 98 | /** 99 | * A non-negative integer specifying the number of items contained in the external property file. 100 | * 101 | */ 102 | @JsonProperty("itemCount") 103 | public Integer getItemCount() { 104 | return itemCount; 105 | } 106 | 107 | /** 108 | * A non-negative integer specifying the number of items contained in the external property file. 109 | * 110 | */ 111 | @JsonProperty("itemCount") 112 | public void setItemCount(Integer itemCount) { 113 | this.itemCount = itemCount; 114 | } 115 | 116 | public ExternalPropertyFileReference withItemCount(Integer itemCount) { 117 | this.itemCount = itemCount; 118 | return this; 119 | } 120 | 121 | /** 122 | * Key/value pairs that provide additional information about the object. 123 | * 124 | */ 125 | @JsonProperty("properties") 126 | public PropertyBag getProperties() { 127 | return properties; 128 | } 129 | 130 | /** 131 | * Key/value pairs that provide additional information about the object. 132 | * 133 | */ 134 | @JsonProperty("properties") 135 | public void setProperties(PropertyBag properties) { 136 | this.properties = properties; 137 | } 138 | 139 | public ExternalPropertyFileReference withProperties(PropertyBag properties) { 140 | this.properties = properties; 141 | return this; 142 | } 143 | 144 | @Override 145 | public String toString() { 146 | StringBuilder sb = new StringBuilder(); 147 | sb.append(ExternalPropertyFileReference.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 148 | sb.append("location"); 149 | sb.append('='); 150 | sb.append(((this.location == null)?"":this.location)); 151 | sb.append(','); 152 | sb.append("guid"); 153 | sb.append('='); 154 | sb.append(((this.guid == null)?"":this.guid)); 155 | sb.append(','); 156 | sb.append("itemCount"); 157 | sb.append('='); 158 | sb.append(((this.itemCount == null)?"":this.itemCount)); 159 | sb.append(','); 160 | sb.append("properties"); 161 | sb.append('='); 162 | sb.append(((this.properties == null)?"":this.properties)); 163 | sb.append(','); 164 | if (sb.charAt((sb.length()- 1)) == ',') { 165 | sb.setCharAt((sb.length()- 1), ']'); 166 | } else { 167 | sb.append(']'); 168 | } 169 | return sb.toString(); 170 | } 171 | 172 | @Override 173 | public int hashCode() { 174 | int result = 1; 175 | result = ((result* 31)+((this.guid == null)? 0 :this.guid.hashCode())); 176 | result = ((result* 31)+((this.location == null)? 0 :this.location.hashCode())); 177 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 178 | result = ((result* 31)+((this.itemCount == null)? 0 :this.itemCount.hashCode())); 179 | return result; 180 | } 181 | 182 | @Override 183 | public boolean equals(Object other) { 184 | if (other == this) { 185 | return true; 186 | } 187 | if ((other instanceof ExternalPropertyFileReference) == false) { 188 | return false; 189 | } 190 | ExternalPropertyFileReference rhs = ((ExternalPropertyFileReference) other); 191 | return (((((this.guid == rhs.guid)||((this.guid!= null)&&this.guid.equals(rhs.guid)))&&((this.location == rhs.location)||((this.location!= null)&&this.location.equals(rhs.location))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.itemCount == rhs.itemCount)||((this.itemCount!= null)&&this.itemCount.equals(rhs.itemCount)))); 192 | } 193 | 194 | } 195 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Conversion.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.Set; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 10 | 11 | 12 | /** 13 | * Describes how a converter transformed the output of a static analysis tool from the analysis tool's native output format into the SARIF format. 14 | * 15 | */ 16 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 17 | @JsonPropertyOrder({ 18 | "tool", 19 | "invocation", 20 | "analysisToolLogFiles", 21 | "properties" 22 | }) 23 | public class Conversion { 24 | 25 | /** 26 | * The analysis tool that was run. 27 | * (Required) 28 | * 29 | */ 30 | @JsonProperty("tool") 31 | @JsonPropertyDescription("The analysis tool that was run.") 32 | private Tool tool; 33 | /** 34 | * The runtime environment of the analysis tool run. 35 | * 36 | */ 37 | @JsonProperty("invocation") 38 | @JsonPropertyDescription("The runtime environment of the analysis tool run.") 39 | private Invocation invocation; 40 | /** 41 | * The locations of the analysis tool's per-run log files. 42 | * 43 | */ 44 | @JsonProperty("analysisToolLogFiles") 45 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 46 | @JsonPropertyDescription("The locations of the analysis tool's per-run log files.") 47 | private Set analysisToolLogFiles = null; 48 | /** 49 | * Key/value pairs that provide additional information about the object. 50 | * 51 | */ 52 | @JsonProperty("properties") 53 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 54 | private PropertyBag properties; 55 | 56 | /** 57 | * The analysis tool that was run. 58 | * (Required) 59 | * 60 | */ 61 | @JsonProperty("tool") 62 | public Tool getTool() { 63 | return tool; 64 | } 65 | 66 | /** 67 | * The analysis tool that was run. 68 | * (Required) 69 | * 70 | */ 71 | @JsonProperty("tool") 72 | public void setTool(Tool tool) { 73 | this.tool = tool; 74 | } 75 | 76 | public Conversion withTool(Tool tool) { 77 | this.tool = tool; 78 | return this; 79 | } 80 | 81 | /** 82 | * The runtime environment of the analysis tool run. 83 | * 84 | */ 85 | @JsonProperty("invocation") 86 | public Invocation getInvocation() { 87 | return invocation; 88 | } 89 | 90 | /** 91 | * The runtime environment of the analysis tool run. 92 | * 93 | */ 94 | @JsonProperty("invocation") 95 | public void setInvocation(Invocation invocation) { 96 | this.invocation = invocation; 97 | } 98 | 99 | public Conversion withInvocation(Invocation invocation) { 100 | this.invocation = invocation; 101 | return this; 102 | } 103 | 104 | /** 105 | * The locations of the analysis tool's per-run log files. 106 | * 107 | */ 108 | @JsonProperty("analysisToolLogFiles") 109 | public Set getAnalysisToolLogFiles() { 110 | return analysisToolLogFiles; 111 | } 112 | 113 | /** 114 | * The locations of the analysis tool's per-run log files. 115 | * 116 | */ 117 | @JsonProperty("analysisToolLogFiles") 118 | public void setAnalysisToolLogFiles(Set analysisToolLogFiles) { 119 | this.analysisToolLogFiles = analysisToolLogFiles; 120 | } 121 | 122 | public Conversion withAnalysisToolLogFiles(Set analysisToolLogFiles) { 123 | this.analysisToolLogFiles = analysisToolLogFiles; 124 | return this; 125 | } 126 | 127 | /** 128 | * Key/value pairs that provide additional information about the object. 129 | * 130 | */ 131 | @JsonProperty("properties") 132 | public PropertyBag getProperties() { 133 | return properties; 134 | } 135 | 136 | /** 137 | * Key/value pairs that provide additional information about the object. 138 | * 139 | */ 140 | @JsonProperty("properties") 141 | public void setProperties(PropertyBag properties) { 142 | this.properties = properties; 143 | } 144 | 145 | public Conversion withProperties(PropertyBag properties) { 146 | this.properties = properties; 147 | return this; 148 | } 149 | 150 | @Override 151 | public String toString() { 152 | StringBuilder sb = new StringBuilder(); 153 | sb.append(Conversion.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 154 | sb.append("tool"); 155 | sb.append('='); 156 | sb.append(((this.tool == null)?"":this.tool)); 157 | sb.append(','); 158 | sb.append("invocation"); 159 | sb.append('='); 160 | sb.append(((this.invocation == null)?"":this.invocation)); 161 | sb.append(','); 162 | sb.append("analysisToolLogFiles"); 163 | sb.append('='); 164 | sb.append(((this.analysisToolLogFiles == null)?"":this.analysisToolLogFiles)); 165 | sb.append(','); 166 | sb.append("properties"); 167 | sb.append('='); 168 | sb.append(((this.properties == null)?"":this.properties)); 169 | sb.append(','); 170 | if (sb.charAt((sb.length()- 1)) == ',') { 171 | sb.setCharAt((sb.length()- 1), ']'); 172 | } else { 173 | sb.append(']'); 174 | } 175 | return sb.toString(); 176 | } 177 | 178 | @Override 179 | public int hashCode() { 180 | int result = 1; 181 | result = ((result* 31)+((this.invocation == null)? 0 :this.invocation.hashCode())); 182 | result = ((result* 31)+((this.analysisToolLogFiles == null)? 0 :this.analysisToolLogFiles.hashCode())); 183 | result = ((result* 31)+((this.tool == null)? 0 :this.tool.hashCode())); 184 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 185 | return result; 186 | } 187 | 188 | @Override 189 | public boolean equals(Object other) { 190 | if (other == this) { 191 | return true; 192 | } 193 | if ((other instanceof Conversion) == false) { 194 | return false; 195 | } 196 | Conversion rhs = ((Conversion) other); 197 | return (((((this.invocation == rhs.invocation)||((this.invocation!= null)&&this.invocation.equals(rhs.invocation)))&&((this.analysisToolLogFiles == rhs.analysisToolLogFiles)||((this.analysisToolLogFiles!= null)&&this.analysisToolLogFiles.equals(rhs.analysisToolLogFiles))))&&((this.tool == rhs.tool)||((this.tool!= null)&&this.tool.equals(rhs.tool))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 198 | } 199 | 200 | } 201 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/LocationRelationship.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.Arrays; 5 | import java.util.LinkedHashSet; 6 | import java.util.Set; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonProperty; 9 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 12 | 13 | 14 | /** 15 | * Information about the relation of one location to another. 16 | * 17 | */ 18 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 19 | @JsonPropertyOrder({ 20 | "target", 21 | "kinds", 22 | "description", 23 | "properties" 24 | }) 25 | public class LocationRelationship { 26 | 27 | /** 28 | * A reference to the related location. 29 | * (Required) 30 | * 31 | */ 32 | @JsonProperty("target") 33 | @JsonPropertyDescription("A reference to the related location.") 34 | private Integer target; 35 | /** 36 | * A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. 37 | * 38 | */ 39 | @JsonProperty("kinds") 40 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 41 | @JsonPropertyDescription("A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'.") 42 | private Set kinds = new LinkedHashSet(Arrays.asList("relevant")); 43 | /** 44 | * Encapsulates a message intended to be read by the end user. 45 | * 46 | */ 47 | @JsonProperty("description") 48 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 49 | private Message description; 50 | /** 51 | * Key/value pairs that provide additional information about the object. 52 | * 53 | */ 54 | @JsonProperty("properties") 55 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 56 | private PropertyBag properties; 57 | 58 | /** 59 | * A reference to the related location. 60 | * (Required) 61 | * 62 | */ 63 | @JsonProperty("target") 64 | public Integer getTarget() { 65 | return target; 66 | } 67 | 68 | /** 69 | * A reference to the related location. 70 | * (Required) 71 | * 72 | */ 73 | @JsonProperty("target") 74 | public void setTarget(Integer target) { 75 | this.target = target; 76 | } 77 | 78 | public LocationRelationship withTarget(Integer target) { 79 | this.target = target; 80 | return this; 81 | } 82 | 83 | /** 84 | * A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. 85 | * 86 | */ 87 | @JsonProperty("kinds") 88 | public Set getKinds() { 89 | return kinds; 90 | } 91 | 92 | /** 93 | * A set of distinct strings that categorize the relationship. Well-known kinds include 'includes', 'isIncludedBy' and 'relevant'. 94 | * 95 | */ 96 | @JsonProperty("kinds") 97 | public void setKinds(Set kinds) { 98 | this.kinds = kinds; 99 | } 100 | 101 | public LocationRelationship withKinds(Set kinds) { 102 | this.kinds = kinds; 103 | return this; 104 | } 105 | 106 | /** 107 | * Encapsulates a message intended to be read by the end user. 108 | * 109 | */ 110 | @JsonProperty("description") 111 | public Message getDescription() { 112 | return description; 113 | } 114 | 115 | /** 116 | * Encapsulates a message intended to be read by the end user. 117 | * 118 | */ 119 | @JsonProperty("description") 120 | public void setDescription(Message description) { 121 | this.description = description; 122 | } 123 | 124 | public LocationRelationship withDescription(Message description) { 125 | this.description = description; 126 | return this; 127 | } 128 | 129 | /** 130 | * Key/value pairs that provide additional information about the object. 131 | * 132 | */ 133 | @JsonProperty("properties") 134 | public PropertyBag getProperties() { 135 | return properties; 136 | } 137 | 138 | /** 139 | * Key/value pairs that provide additional information about the object. 140 | * 141 | */ 142 | @JsonProperty("properties") 143 | public void setProperties(PropertyBag properties) { 144 | this.properties = properties; 145 | } 146 | 147 | public LocationRelationship withProperties(PropertyBag properties) { 148 | this.properties = properties; 149 | return this; 150 | } 151 | 152 | @Override 153 | public String toString() { 154 | StringBuilder sb = new StringBuilder(); 155 | sb.append(LocationRelationship.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 156 | sb.append("target"); 157 | sb.append('='); 158 | sb.append(((this.target == null)?"":this.target)); 159 | sb.append(','); 160 | sb.append("kinds"); 161 | sb.append('='); 162 | sb.append(((this.kinds == null)?"":this.kinds)); 163 | sb.append(','); 164 | sb.append("description"); 165 | sb.append('='); 166 | sb.append(((this.description == null)?"":this.description)); 167 | sb.append(','); 168 | sb.append("properties"); 169 | sb.append('='); 170 | sb.append(((this.properties == null)?"":this.properties)); 171 | sb.append(','); 172 | if (sb.charAt((sb.length()- 1)) == ',') { 173 | sb.setCharAt((sb.length()- 1), ']'); 174 | } else { 175 | sb.append(']'); 176 | } 177 | return sb.toString(); 178 | } 179 | 180 | @Override 181 | public int hashCode() { 182 | int result = 1; 183 | result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); 184 | result = ((result* 31)+((this.kinds == null)? 0 :this.kinds.hashCode())); 185 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 186 | result = ((result* 31)+((this.target == null)? 0 :this.target.hashCode())); 187 | return result; 188 | } 189 | 190 | @Override 191 | public boolean equals(Object other) { 192 | if (other == this) { 193 | return true; 194 | } 195 | if ((other instanceof LocationRelationship) == false) { 196 | return false; 197 | } 198 | LocationRelationship rhs = ((LocationRelationship) other); 199 | return (((((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.kinds == rhs.kinds)||((this.kinds!= null)&&this.kinds.equals(rhs.kinds))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.target == rhs.target)||((this.target!= null)&&this.target.equals(rhs.target)))); 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Message.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.List; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | 10 | 11 | /** 12 | * Encapsulates a message intended to be read by the end user. 13 | * 14 | */ 15 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 16 | @JsonPropertyOrder({ 17 | "text", 18 | "markdown", 19 | "id", 20 | "arguments", 21 | "properties" 22 | }) 23 | public class Message { 24 | 25 | /** 26 | * A plain text message string. 27 | * 28 | */ 29 | @JsonProperty("text") 30 | @JsonPropertyDescription("A plain text message string.") 31 | private String text; 32 | /** 33 | * A Markdown message string. 34 | * 35 | */ 36 | @JsonProperty("markdown") 37 | @JsonPropertyDescription("A Markdown message string.") 38 | private String markdown; 39 | /** 40 | * The identifier for this message. 41 | * 42 | */ 43 | @JsonProperty("id") 44 | @JsonPropertyDescription("The identifier for this message.") 45 | private String id; 46 | /** 47 | * An array of strings to substitute into the message string. 48 | * 49 | */ 50 | @JsonProperty("arguments") 51 | @JsonPropertyDescription("An array of strings to substitute into the message string.") 52 | private List arguments = null; 53 | /** 54 | * Key/value pairs that provide additional information about the object. 55 | * 56 | */ 57 | @JsonProperty("properties") 58 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 59 | private PropertyBag properties; 60 | 61 | /** 62 | * A plain text message string. 63 | * 64 | */ 65 | @JsonProperty("text") 66 | public String getText() { 67 | return text; 68 | } 69 | 70 | /** 71 | * A plain text message string. 72 | * 73 | */ 74 | @JsonProperty("text") 75 | public void setText(String text) { 76 | this.text = text; 77 | } 78 | 79 | public Message withText(String text) { 80 | this.text = text; 81 | return this; 82 | } 83 | 84 | /** 85 | * A Markdown message string. 86 | * 87 | */ 88 | @JsonProperty("markdown") 89 | public String getMarkdown() { 90 | return markdown; 91 | } 92 | 93 | /** 94 | * A Markdown message string. 95 | * 96 | */ 97 | @JsonProperty("markdown") 98 | public void setMarkdown(String markdown) { 99 | this.markdown = markdown; 100 | } 101 | 102 | public Message withMarkdown(String markdown) { 103 | this.markdown = markdown; 104 | return this; 105 | } 106 | 107 | /** 108 | * The identifier for this message. 109 | * 110 | */ 111 | @JsonProperty("id") 112 | public String getId() { 113 | return id; 114 | } 115 | 116 | /** 117 | * The identifier for this message. 118 | * 119 | */ 120 | @JsonProperty("id") 121 | public void setId(String id) { 122 | this.id = id; 123 | } 124 | 125 | public Message withId(String id) { 126 | this.id = id; 127 | return this; 128 | } 129 | 130 | /** 131 | * An array of strings to substitute into the message string. 132 | * 133 | */ 134 | @JsonProperty("arguments") 135 | public List getArguments() { 136 | return arguments; 137 | } 138 | 139 | /** 140 | * An array of strings to substitute into the message string. 141 | * 142 | */ 143 | @JsonProperty("arguments") 144 | public void setArguments(List arguments) { 145 | this.arguments = arguments; 146 | } 147 | 148 | public Message withArguments(List arguments) { 149 | this.arguments = arguments; 150 | return this; 151 | } 152 | 153 | /** 154 | * Key/value pairs that provide additional information about the object. 155 | * 156 | */ 157 | @JsonProperty("properties") 158 | public PropertyBag getProperties() { 159 | return properties; 160 | } 161 | 162 | /** 163 | * Key/value pairs that provide additional information about the object. 164 | * 165 | */ 166 | @JsonProperty("properties") 167 | public void setProperties(PropertyBag properties) { 168 | this.properties = properties; 169 | } 170 | 171 | public Message withProperties(PropertyBag properties) { 172 | this.properties = properties; 173 | return this; 174 | } 175 | 176 | @Override 177 | public String toString() { 178 | StringBuilder sb = new StringBuilder(); 179 | sb.append(Message.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 180 | sb.append("text"); 181 | sb.append('='); 182 | sb.append(((this.text == null)?"":this.text)); 183 | sb.append(','); 184 | sb.append("markdown"); 185 | sb.append('='); 186 | sb.append(((this.markdown == null)?"":this.markdown)); 187 | sb.append(','); 188 | sb.append("id"); 189 | sb.append('='); 190 | sb.append(((this.id == null)?"":this.id)); 191 | sb.append(','); 192 | sb.append("arguments"); 193 | sb.append('='); 194 | sb.append(((this.arguments == null)?"":this.arguments)); 195 | sb.append(','); 196 | sb.append("properties"); 197 | sb.append('='); 198 | sb.append(((this.properties == null)?"":this.properties)); 199 | sb.append(','); 200 | if (sb.charAt((sb.length()- 1)) == ',') { 201 | sb.setCharAt((sb.length()- 1), ']'); 202 | } else { 203 | sb.append(']'); 204 | } 205 | return sb.toString(); 206 | } 207 | 208 | @Override 209 | public int hashCode() { 210 | int result = 1; 211 | result = ((result* 31)+((this.markdown == null)? 0 :this.markdown.hashCode())); 212 | result = ((result* 31)+((this.arguments == null)? 0 :this.arguments.hashCode())); 213 | result = ((result* 31)+((this.text == null)? 0 :this.text.hashCode())); 214 | result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); 215 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 216 | return result; 217 | } 218 | 219 | @Override 220 | public boolean equals(Object other) { 221 | if (other == this) { 222 | return true; 223 | } 224 | if ((other instanceof Message) == false) { 225 | return false; 226 | } 227 | Message rhs = ((Message) other); 228 | return ((((((this.markdown == rhs.markdown)||((this.markdown!= null)&&this.markdown.equals(rhs.markdown)))&&((this.arguments == rhs.arguments)||((this.arguments!= null)&&this.arguments.equals(rhs.arguments))))&&((this.text == rhs.text)||((this.text!= null)&&this.text.equals(rhs.text))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 229 | } 230 | 231 | } 232 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Node.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.Set; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 10 | 11 | 12 | /** 13 | * Represents a node in a graph. 14 | * 15 | */ 16 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 17 | @JsonPropertyOrder({ 18 | "id", 19 | "label", 20 | "location", 21 | "children", 22 | "properties" 23 | }) 24 | public class Node { 25 | 26 | /** 27 | * A string that uniquely identifies the node within its graph. 28 | * (Required) 29 | * 30 | */ 31 | @JsonProperty("id") 32 | @JsonPropertyDescription("A string that uniquely identifies the node within its graph.") 33 | private String id; 34 | /** 35 | * Encapsulates a message intended to be read by the end user. 36 | * 37 | */ 38 | @JsonProperty("label") 39 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 40 | private Message label; 41 | /** 42 | * A location within a programming artifact. 43 | * 44 | */ 45 | @JsonProperty("location") 46 | @JsonPropertyDescription("A location within a programming artifact.") 47 | private Location location; 48 | /** 49 | * Array of child nodes. 50 | * 51 | */ 52 | @JsonProperty("children") 53 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 54 | @JsonPropertyDescription("Array of child nodes.") 55 | private Set children = null; 56 | /** 57 | * Key/value pairs that provide additional information about the object. 58 | * 59 | */ 60 | @JsonProperty("properties") 61 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 62 | private PropertyBag properties; 63 | 64 | /** 65 | * A string that uniquely identifies the node within its graph. 66 | * (Required) 67 | * 68 | */ 69 | @JsonProperty("id") 70 | public String getId() { 71 | return id; 72 | } 73 | 74 | /** 75 | * A string that uniquely identifies the node within its graph. 76 | * (Required) 77 | * 78 | */ 79 | @JsonProperty("id") 80 | public void setId(String id) { 81 | this.id = id; 82 | } 83 | 84 | public Node withId(String id) { 85 | this.id = id; 86 | return this; 87 | } 88 | 89 | /** 90 | * Encapsulates a message intended to be read by the end user. 91 | * 92 | */ 93 | @JsonProperty("label") 94 | public Message getLabel() { 95 | return label; 96 | } 97 | 98 | /** 99 | * Encapsulates a message intended to be read by the end user. 100 | * 101 | */ 102 | @JsonProperty("label") 103 | public void setLabel(Message label) { 104 | this.label = label; 105 | } 106 | 107 | public Node withLabel(Message label) { 108 | this.label = label; 109 | return this; 110 | } 111 | 112 | /** 113 | * A location within a programming artifact. 114 | * 115 | */ 116 | @JsonProperty("location") 117 | public Location getLocation() { 118 | return location; 119 | } 120 | 121 | /** 122 | * A location within a programming artifact. 123 | * 124 | */ 125 | @JsonProperty("location") 126 | public void setLocation(Location location) { 127 | this.location = location; 128 | } 129 | 130 | public Node withLocation(Location location) { 131 | this.location = location; 132 | return this; 133 | } 134 | 135 | /** 136 | * Array of child nodes. 137 | * 138 | */ 139 | @JsonProperty("children") 140 | public Set getChildren() { 141 | return children; 142 | } 143 | 144 | /** 145 | * Array of child nodes. 146 | * 147 | */ 148 | @JsonProperty("children") 149 | public void setChildren(Set children) { 150 | this.children = children; 151 | } 152 | 153 | public Node withChildren(Set children) { 154 | this.children = children; 155 | return this; 156 | } 157 | 158 | /** 159 | * Key/value pairs that provide additional information about the object. 160 | * 161 | */ 162 | @JsonProperty("properties") 163 | public PropertyBag getProperties() { 164 | return properties; 165 | } 166 | 167 | /** 168 | * Key/value pairs that provide additional information about the object. 169 | * 170 | */ 171 | @JsonProperty("properties") 172 | public void setProperties(PropertyBag properties) { 173 | this.properties = properties; 174 | } 175 | 176 | public Node withProperties(PropertyBag properties) { 177 | this.properties = properties; 178 | return this; 179 | } 180 | 181 | @Override 182 | public String toString() { 183 | StringBuilder sb = new StringBuilder(); 184 | sb.append(Node.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 185 | sb.append("id"); 186 | sb.append('='); 187 | sb.append(((this.id == null)?"":this.id)); 188 | sb.append(','); 189 | sb.append("label"); 190 | sb.append('='); 191 | sb.append(((this.label == null)?"":this.label)); 192 | sb.append(','); 193 | sb.append("location"); 194 | sb.append('='); 195 | sb.append(((this.location == null)?"":this.location)); 196 | sb.append(','); 197 | sb.append("children"); 198 | sb.append('='); 199 | sb.append(((this.children == null)?"":this.children)); 200 | sb.append(','); 201 | sb.append("properties"); 202 | sb.append('='); 203 | sb.append(((this.properties == null)?"":this.properties)); 204 | sb.append(','); 205 | if (sb.charAt((sb.length()- 1)) == ',') { 206 | sb.setCharAt((sb.length()- 1), ']'); 207 | } else { 208 | sb.append(']'); 209 | } 210 | return sb.toString(); 211 | } 212 | 213 | @Override 214 | public int hashCode() { 215 | int result = 1; 216 | result = ((result* 31)+((this.location == null)? 0 :this.location.hashCode())); 217 | result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); 218 | result = ((result* 31)+((this.label == null)? 0 :this.label.hashCode())); 219 | result = ((result* 31)+((this.children == null)? 0 :this.children.hashCode())); 220 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 221 | return result; 222 | } 223 | 224 | @Override 225 | public boolean equals(Object other) { 226 | if (other == this) { 227 | return true; 228 | } 229 | if ((other instanceof Node) == false) { 230 | return false; 231 | } 232 | Node rhs = ((Node) other); 233 | return ((((((this.location == rhs.location)||((this.location!= null)&&this.location.equals(rhs.location)))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.label == rhs.label)||((this.label!= null)&&this.label.equals(rhs.label))))&&((this.children == rhs.children)||((this.children!= null)&&this.children.equals(rhs.children))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 234 | } 235 | 236 | } 237 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/StackFrame.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.List; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | 10 | 11 | /** 12 | * A function call within a stack trace. 13 | * 14 | */ 15 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 16 | @JsonPropertyOrder({ 17 | "location", 18 | "module", 19 | "threadId", 20 | "parameters", 21 | "properties" 22 | }) 23 | public class StackFrame { 24 | 25 | /** 26 | * A location within a programming artifact. 27 | * 28 | */ 29 | @JsonProperty("location") 30 | @JsonPropertyDescription("A location within a programming artifact.") 31 | private Location location; 32 | /** 33 | * The name of the module that contains the code of this stack frame. 34 | * 35 | */ 36 | @JsonProperty("module") 37 | @JsonPropertyDescription("The name of the module that contains the code of this stack frame.") 38 | private String module; 39 | /** 40 | * The thread identifier of the stack frame. 41 | * 42 | */ 43 | @JsonProperty("threadId") 44 | @JsonPropertyDescription("The thread identifier of the stack frame.") 45 | private Integer threadId; 46 | /** 47 | * The parameters of the call that is executing. 48 | * 49 | */ 50 | @JsonProperty("parameters") 51 | @JsonPropertyDescription("The parameters of the call that is executing.") 52 | private List parameters = null; 53 | /** 54 | * Key/value pairs that provide additional information about the object. 55 | * 56 | */ 57 | @JsonProperty("properties") 58 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 59 | private PropertyBag properties; 60 | 61 | /** 62 | * A location within a programming artifact. 63 | * 64 | */ 65 | @JsonProperty("location") 66 | public Location getLocation() { 67 | return location; 68 | } 69 | 70 | /** 71 | * A location within a programming artifact. 72 | * 73 | */ 74 | @JsonProperty("location") 75 | public void setLocation(Location location) { 76 | this.location = location; 77 | } 78 | 79 | public StackFrame withLocation(Location location) { 80 | this.location = location; 81 | return this; 82 | } 83 | 84 | /** 85 | * The name of the module that contains the code of this stack frame. 86 | * 87 | */ 88 | @JsonProperty("module") 89 | public String getModule() { 90 | return module; 91 | } 92 | 93 | /** 94 | * The name of the module that contains the code of this stack frame. 95 | * 96 | */ 97 | @JsonProperty("module") 98 | public void setModule(String module) { 99 | this.module = module; 100 | } 101 | 102 | public StackFrame withModule(String module) { 103 | this.module = module; 104 | return this; 105 | } 106 | 107 | /** 108 | * The thread identifier of the stack frame. 109 | * 110 | */ 111 | @JsonProperty("threadId") 112 | public Integer getThreadId() { 113 | return threadId; 114 | } 115 | 116 | /** 117 | * The thread identifier of the stack frame. 118 | * 119 | */ 120 | @JsonProperty("threadId") 121 | public void setThreadId(Integer threadId) { 122 | this.threadId = threadId; 123 | } 124 | 125 | public StackFrame withThreadId(Integer threadId) { 126 | this.threadId = threadId; 127 | return this; 128 | } 129 | 130 | /** 131 | * The parameters of the call that is executing. 132 | * 133 | */ 134 | @JsonProperty("parameters") 135 | public List getParameters() { 136 | return parameters; 137 | } 138 | 139 | /** 140 | * The parameters of the call that is executing. 141 | * 142 | */ 143 | @JsonProperty("parameters") 144 | public void setParameters(List parameters) { 145 | this.parameters = parameters; 146 | } 147 | 148 | public StackFrame withParameters(List parameters) { 149 | this.parameters = parameters; 150 | return this; 151 | } 152 | 153 | /** 154 | * Key/value pairs that provide additional information about the object. 155 | * 156 | */ 157 | @JsonProperty("properties") 158 | public PropertyBag getProperties() { 159 | return properties; 160 | } 161 | 162 | /** 163 | * Key/value pairs that provide additional information about the object. 164 | * 165 | */ 166 | @JsonProperty("properties") 167 | public void setProperties(PropertyBag properties) { 168 | this.properties = properties; 169 | } 170 | 171 | public StackFrame withProperties(PropertyBag properties) { 172 | this.properties = properties; 173 | return this; 174 | } 175 | 176 | @Override 177 | public String toString() { 178 | StringBuilder sb = new StringBuilder(); 179 | sb.append(StackFrame.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 180 | sb.append("location"); 181 | sb.append('='); 182 | sb.append(((this.location == null)?"":this.location)); 183 | sb.append(','); 184 | sb.append("module"); 185 | sb.append('='); 186 | sb.append(((this.module == null)?"":this.module)); 187 | sb.append(','); 188 | sb.append("threadId"); 189 | sb.append('='); 190 | sb.append(((this.threadId == null)?"":this.threadId)); 191 | sb.append(','); 192 | sb.append("parameters"); 193 | sb.append('='); 194 | sb.append(((this.parameters == null)?"":this.parameters)); 195 | sb.append(','); 196 | sb.append("properties"); 197 | sb.append('='); 198 | sb.append(((this.properties == null)?"":this.properties)); 199 | sb.append(','); 200 | if (sb.charAt((sb.length()- 1)) == ',') { 201 | sb.setCharAt((sb.length()- 1), ']'); 202 | } else { 203 | sb.append(']'); 204 | } 205 | return sb.toString(); 206 | } 207 | 208 | @Override 209 | public int hashCode() { 210 | int result = 1; 211 | result = ((result* 31)+((this.threadId == null)? 0 :this.threadId.hashCode())); 212 | result = ((result* 31)+((this.location == null)? 0 :this.location.hashCode())); 213 | result = ((result* 31)+((this.parameters == null)? 0 :this.parameters.hashCode())); 214 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 215 | result = ((result* 31)+((this.module == null)? 0 :this.module.hashCode())); 216 | return result; 217 | } 218 | 219 | @Override 220 | public boolean equals(Object other) { 221 | if (other == this) { 222 | return true; 223 | } 224 | if ((other instanceof StackFrame) == false) { 225 | return false; 226 | } 227 | StackFrame rhs = ((StackFrame) other); 228 | return ((((((this.threadId == rhs.threadId)||((this.threadId!= null)&&this.threadId.equals(rhs.threadId)))&&((this.location == rhs.location)||((this.location!= null)&&this.location.equals(rhs.location))))&&((this.parameters == rhs.parameters)||((this.parameters!= null)&&this.parameters.equals(rhs.parameters))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.module == rhs.module)||((this.module!= null)&&this.module.equals(rhs.module)))); 229 | } 230 | 231 | } 232 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ReportingDescriptorRelationship.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.Arrays; 5 | import java.util.LinkedHashSet; 6 | import java.util.Set; 7 | import com.fasterxml.jackson.annotation.JsonInclude; 8 | import com.fasterxml.jackson.annotation.JsonProperty; 9 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 10 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 11 | import com.fasterxml.jackson.databind.annotation.JsonDeserialize; 12 | 13 | 14 | /** 15 | * Information about the relation of one reporting descriptor to another. 16 | * 17 | */ 18 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 19 | @JsonPropertyOrder({ 20 | "target", 21 | "kinds", 22 | "description", 23 | "properties" 24 | }) 25 | public class ReportingDescriptorRelationship { 26 | 27 | /** 28 | * Information about how to locate a relevant reporting descriptor. 29 | * (Required) 30 | * 31 | */ 32 | @JsonProperty("target") 33 | @JsonPropertyDescription("Information about how to locate a relevant reporting descriptor.") 34 | private ReportingDescriptorReference target; 35 | /** 36 | * A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. 37 | * 38 | */ 39 | @JsonProperty("kinds") 40 | @JsonDeserialize(as = java.util.LinkedHashSet.class) 41 | @JsonPropertyDescription("A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'.") 42 | private Set kinds = new LinkedHashSet(Arrays.asList("relevant")); 43 | /** 44 | * Encapsulates a message intended to be read by the end user. 45 | * 46 | */ 47 | @JsonProperty("description") 48 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 49 | private Message description; 50 | /** 51 | * Key/value pairs that provide additional information about the object. 52 | * 53 | */ 54 | @JsonProperty("properties") 55 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 56 | private PropertyBag properties; 57 | 58 | /** 59 | * Information about how to locate a relevant reporting descriptor. 60 | * (Required) 61 | * 62 | */ 63 | @JsonProperty("target") 64 | public ReportingDescriptorReference getTarget() { 65 | return target; 66 | } 67 | 68 | /** 69 | * Information about how to locate a relevant reporting descriptor. 70 | * (Required) 71 | * 72 | */ 73 | @JsonProperty("target") 74 | public void setTarget(ReportingDescriptorReference target) { 75 | this.target = target; 76 | } 77 | 78 | public ReportingDescriptorRelationship withTarget(ReportingDescriptorReference target) { 79 | this.target = target; 80 | return this; 81 | } 82 | 83 | /** 84 | * A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. 85 | * 86 | */ 87 | @JsonProperty("kinds") 88 | public Set getKinds() { 89 | return kinds; 90 | } 91 | 92 | /** 93 | * A set of distinct strings that categorize the relationship. Well-known kinds include 'canPrecede', 'canFollow', 'willPrecede', 'willFollow', 'superset', 'subset', 'equal', 'disjoint', 'relevant', and 'incomparable'. 94 | * 95 | */ 96 | @JsonProperty("kinds") 97 | public void setKinds(Set kinds) { 98 | this.kinds = kinds; 99 | } 100 | 101 | public ReportingDescriptorRelationship withKinds(Set kinds) { 102 | this.kinds = kinds; 103 | return this; 104 | } 105 | 106 | /** 107 | * Encapsulates a message intended to be read by the end user. 108 | * 109 | */ 110 | @JsonProperty("description") 111 | public Message getDescription() { 112 | return description; 113 | } 114 | 115 | /** 116 | * Encapsulates a message intended to be read by the end user. 117 | * 118 | */ 119 | @JsonProperty("description") 120 | public void setDescription(Message description) { 121 | this.description = description; 122 | } 123 | 124 | public ReportingDescriptorRelationship withDescription(Message description) { 125 | this.description = description; 126 | return this; 127 | } 128 | 129 | /** 130 | * Key/value pairs that provide additional information about the object. 131 | * 132 | */ 133 | @JsonProperty("properties") 134 | public PropertyBag getProperties() { 135 | return properties; 136 | } 137 | 138 | /** 139 | * Key/value pairs that provide additional information about the object. 140 | * 141 | */ 142 | @JsonProperty("properties") 143 | public void setProperties(PropertyBag properties) { 144 | this.properties = properties; 145 | } 146 | 147 | public ReportingDescriptorRelationship withProperties(PropertyBag properties) { 148 | this.properties = properties; 149 | return this; 150 | } 151 | 152 | @Override 153 | public String toString() { 154 | StringBuilder sb = new StringBuilder(); 155 | sb.append(ReportingDescriptorRelationship.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 156 | sb.append("target"); 157 | sb.append('='); 158 | sb.append(((this.target == null)?"":this.target)); 159 | sb.append(','); 160 | sb.append("kinds"); 161 | sb.append('='); 162 | sb.append(((this.kinds == null)?"":this.kinds)); 163 | sb.append(','); 164 | sb.append("description"); 165 | sb.append('='); 166 | sb.append(((this.description == null)?"":this.description)); 167 | sb.append(','); 168 | sb.append("properties"); 169 | sb.append('='); 170 | sb.append(((this.properties == null)?"":this.properties)); 171 | sb.append(','); 172 | if (sb.charAt((sb.length()- 1)) == ',') { 173 | sb.setCharAt((sb.length()- 1), ']'); 174 | } else { 175 | sb.append(']'); 176 | } 177 | return sb.toString(); 178 | } 179 | 180 | @Override 181 | public int hashCode() { 182 | int result = 1; 183 | result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); 184 | result = ((result* 31)+((this.kinds == null)? 0 :this.kinds.hashCode())); 185 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 186 | result = ((result* 31)+((this.target == null)? 0 :this.target.hashCode())); 187 | return result; 188 | } 189 | 190 | @Override 191 | public boolean equals(Object other) { 192 | if (other == this) { 193 | return true; 194 | } 195 | if ((other instanceof ReportingDescriptorRelationship) == false) { 196 | return false; 197 | } 198 | ReportingDescriptorRelationship rhs = ((ReportingDescriptorRelationship) other); 199 | return (((((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description)))&&((this.kinds == rhs.kinds)||((this.kinds!= null)&&this.kinds.equals(rhs.kinds))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.target == rhs.target)||((this.target!= null)&&this.target.equals(rhs.target)))); 200 | } 201 | 202 | } 203 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Edge.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Represents a directed edge in a graph. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "id", 17 | "label", 18 | "sourceNodeId", 19 | "targetNodeId", 20 | "properties" 21 | }) 22 | public class Edge { 23 | 24 | /** 25 | * A string that uniquely identifies the edge within its graph. 26 | * (Required) 27 | * 28 | */ 29 | @JsonProperty("id") 30 | @JsonPropertyDescription("A string that uniquely identifies the edge within its graph.") 31 | private String id; 32 | /** 33 | * Encapsulates a message intended to be read by the end user. 34 | * 35 | */ 36 | @JsonProperty("label") 37 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 38 | private Message label; 39 | /** 40 | * Identifies the source node (the node at which the edge starts). 41 | * (Required) 42 | * 43 | */ 44 | @JsonProperty("sourceNodeId") 45 | @JsonPropertyDescription("Identifies the source node (the node at which the edge starts).") 46 | private String sourceNodeId; 47 | /** 48 | * Identifies the target node (the node at which the edge ends). 49 | * (Required) 50 | * 51 | */ 52 | @JsonProperty("targetNodeId") 53 | @JsonPropertyDescription("Identifies the target node (the node at which the edge ends).") 54 | private String targetNodeId; 55 | /** 56 | * Key/value pairs that provide additional information about the object. 57 | * 58 | */ 59 | @JsonProperty("properties") 60 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 61 | private PropertyBag properties; 62 | 63 | /** 64 | * A string that uniquely identifies the edge within its graph. 65 | * (Required) 66 | * 67 | */ 68 | @JsonProperty("id") 69 | public String getId() { 70 | return id; 71 | } 72 | 73 | /** 74 | * A string that uniquely identifies the edge within its graph. 75 | * (Required) 76 | * 77 | */ 78 | @JsonProperty("id") 79 | public void setId(String id) { 80 | this.id = id; 81 | } 82 | 83 | public Edge withId(String id) { 84 | this.id = id; 85 | return this; 86 | } 87 | 88 | /** 89 | * Encapsulates a message intended to be read by the end user. 90 | * 91 | */ 92 | @JsonProperty("label") 93 | public Message getLabel() { 94 | return label; 95 | } 96 | 97 | /** 98 | * Encapsulates a message intended to be read by the end user. 99 | * 100 | */ 101 | @JsonProperty("label") 102 | public void setLabel(Message label) { 103 | this.label = label; 104 | } 105 | 106 | public Edge withLabel(Message label) { 107 | this.label = label; 108 | return this; 109 | } 110 | 111 | /** 112 | * Identifies the source node (the node at which the edge starts). 113 | * (Required) 114 | * 115 | */ 116 | @JsonProperty("sourceNodeId") 117 | public String getSourceNodeId() { 118 | return sourceNodeId; 119 | } 120 | 121 | /** 122 | * Identifies the source node (the node at which the edge starts). 123 | * (Required) 124 | * 125 | */ 126 | @JsonProperty("sourceNodeId") 127 | public void setSourceNodeId(String sourceNodeId) { 128 | this.sourceNodeId = sourceNodeId; 129 | } 130 | 131 | public Edge withSourceNodeId(String sourceNodeId) { 132 | this.sourceNodeId = sourceNodeId; 133 | return this; 134 | } 135 | 136 | /** 137 | * Identifies the target node (the node at which the edge ends). 138 | * (Required) 139 | * 140 | */ 141 | @JsonProperty("targetNodeId") 142 | public String getTargetNodeId() { 143 | return targetNodeId; 144 | } 145 | 146 | /** 147 | * Identifies the target node (the node at which the edge ends). 148 | * (Required) 149 | * 150 | */ 151 | @JsonProperty("targetNodeId") 152 | public void setTargetNodeId(String targetNodeId) { 153 | this.targetNodeId = targetNodeId; 154 | } 155 | 156 | public Edge withTargetNodeId(String targetNodeId) { 157 | this.targetNodeId = targetNodeId; 158 | return this; 159 | } 160 | 161 | /** 162 | * Key/value pairs that provide additional information about the object. 163 | * 164 | */ 165 | @JsonProperty("properties") 166 | public PropertyBag getProperties() { 167 | return properties; 168 | } 169 | 170 | /** 171 | * Key/value pairs that provide additional information about the object. 172 | * 173 | */ 174 | @JsonProperty("properties") 175 | public void setProperties(PropertyBag properties) { 176 | this.properties = properties; 177 | } 178 | 179 | public Edge withProperties(PropertyBag properties) { 180 | this.properties = properties; 181 | return this; 182 | } 183 | 184 | @Override 185 | public String toString() { 186 | StringBuilder sb = new StringBuilder(); 187 | sb.append(Edge.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 188 | sb.append("id"); 189 | sb.append('='); 190 | sb.append(((this.id == null)?"":this.id)); 191 | sb.append(','); 192 | sb.append("label"); 193 | sb.append('='); 194 | sb.append(((this.label == null)?"":this.label)); 195 | sb.append(','); 196 | sb.append("sourceNodeId"); 197 | sb.append('='); 198 | sb.append(((this.sourceNodeId == null)?"":this.sourceNodeId)); 199 | sb.append(','); 200 | sb.append("targetNodeId"); 201 | sb.append('='); 202 | sb.append(((this.targetNodeId == null)?"":this.targetNodeId)); 203 | sb.append(','); 204 | sb.append("properties"); 205 | sb.append('='); 206 | sb.append(((this.properties == null)?"":this.properties)); 207 | sb.append(','); 208 | if (sb.charAt((sb.length()- 1)) == ',') { 209 | sb.setCharAt((sb.length()- 1), ']'); 210 | } else { 211 | sb.append(']'); 212 | } 213 | return sb.toString(); 214 | } 215 | 216 | @Override 217 | public int hashCode() { 218 | int result = 1; 219 | result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); 220 | result = ((result* 31)+((this.label == null)? 0 :this.label.hashCode())); 221 | result = ((result* 31)+((this.targetNodeId == null)? 0 :this.targetNodeId.hashCode())); 222 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 223 | result = ((result* 31)+((this.sourceNodeId == null)? 0 :this.sourceNodeId.hashCode())); 224 | return result; 225 | } 226 | 227 | @Override 228 | public boolean equals(Object other) { 229 | if (other == this) { 230 | return true; 231 | } 232 | if ((other instanceof Edge) == false) { 233 | return false; 234 | } 235 | Edge rhs = ((Edge) other); 236 | return ((((((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id)))&&((this.label == rhs.label)||((this.label!= null)&&this.label.equals(rhs.label))))&&((this.targetNodeId == rhs.targetNodeId)||((this.targetNodeId!= null)&&this.targetNodeId.equals(rhs.targetNodeId))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.sourceNodeId == rhs.sourceNodeId)||((this.sourceNodeId!= null)&&this.sourceNodeId.equals(rhs.sourceNodeId)))); 237 | } 238 | 239 | } 240 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/EdgeTraversal.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Represents the traversal of a single edge during a graph traversal. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "edgeId", 17 | "message", 18 | "finalState", 19 | "stepOverEdgeCount", 20 | "properties" 21 | }) 22 | public class EdgeTraversal { 23 | 24 | /** 25 | * Identifies the edge being traversed. 26 | * (Required) 27 | * 28 | */ 29 | @JsonProperty("edgeId") 30 | @JsonPropertyDescription("Identifies the edge being traversed.") 31 | private String edgeId; 32 | /** 33 | * Encapsulates a message intended to be read by the end user. 34 | * 35 | */ 36 | @JsonProperty("message") 37 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 38 | private Message message; 39 | /** 40 | * The values of relevant expressions after the edge has been traversed. 41 | * 42 | */ 43 | @JsonProperty("finalState") 44 | @JsonPropertyDescription("The values of relevant expressions after the edge has been traversed.") 45 | private FinalState finalState; 46 | /** 47 | * The number of edge traversals necessary to return from a nested graph. 48 | * 49 | */ 50 | @JsonProperty("stepOverEdgeCount") 51 | @JsonPropertyDescription("The number of edge traversals necessary to return from a nested graph.") 52 | private Integer stepOverEdgeCount; 53 | /** 54 | * Key/value pairs that provide additional information about the object. 55 | * 56 | */ 57 | @JsonProperty("properties") 58 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 59 | private PropertyBag properties; 60 | 61 | /** 62 | * Identifies the edge being traversed. 63 | * (Required) 64 | * 65 | */ 66 | @JsonProperty("edgeId") 67 | public String getEdgeId() { 68 | return edgeId; 69 | } 70 | 71 | /** 72 | * Identifies the edge being traversed. 73 | * (Required) 74 | * 75 | */ 76 | @JsonProperty("edgeId") 77 | public void setEdgeId(String edgeId) { 78 | this.edgeId = edgeId; 79 | } 80 | 81 | public EdgeTraversal withEdgeId(String edgeId) { 82 | this.edgeId = edgeId; 83 | return this; 84 | } 85 | 86 | /** 87 | * Encapsulates a message intended to be read by the end user. 88 | * 89 | */ 90 | @JsonProperty("message") 91 | public Message getMessage() { 92 | return message; 93 | } 94 | 95 | /** 96 | * Encapsulates a message intended to be read by the end user. 97 | * 98 | */ 99 | @JsonProperty("message") 100 | public void setMessage(Message message) { 101 | this.message = message; 102 | } 103 | 104 | public EdgeTraversal withMessage(Message message) { 105 | this.message = message; 106 | return this; 107 | } 108 | 109 | /** 110 | * The values of relevant expressions after the edge has been traversed. 111 | * 112 | */ 113 | @JsonProperty("finalState") 114 | public FinalState getFinalState() { 115 | return finalState; 116 | } 117 | 118 | /** 119 | * The values of relevant expressions after the edge has been traversed. 120 | * 121 | */ 122 | @JsonProperty("finalState") 123 | public void setFinalState(FinalState finalState) { 124 | this.finalState = finalState; 125 | } 126 | 127 | public EdgeTraversal withFinalState(FinalState finalState) { 128 | this.finalState = finalState; 129 | return this; 130 | } 131 | 132 | /** 133 | * The number of edge traversals necessary to return from a nested graph. 134 | * 135 | */ 136 | @JsonProperty("stepOverEdgeCount") 137 | public Integer getStepOverEdgeCount() { 138 | return stepOverEdgeCount; 139 | } 140 | 141 | /** 142 | * The number of edge traversals necessary to return from a nested graph. 143 | * 144 | */ 145 | @JsonProperty("stepOverEdgeCount") 146 | public void setStepOverEdgeCount(Integer stepOverEdgeCount) { 147 | this.stepOverEdgeCount = stepOverEdgeCount; 148 | } 149 | 150 | public EdgeTraversal withStepOverEdgeCount(Integer stepOverEdgeCount) { 151 | this.stepOverEdgeCount = stepOverEdgeCount; 152 | return this; 153 | } 154 | 155 | /** 156 | * Key/value pairs that provide additional information about the object. 157 | * 158 | */ 159 | @JsonProperty("properties") 160 | public PropertyBag getProperties() { 161 | return properties; 162 | } 163 | 164 | /** 165 | * Key/value pairs that provide additional information about the object. 166 | * 167 | */ 168 | @JsonProperty("properties") 169 | public void setProperties(PropertyBag properties) { 170 | this.properties = properties; 171 | } 172 | 173 | public EdgeTraversal withProperties(PropertyBag properties) { 174 | this.properties = properties; 175 | return this; 176 | } 177 | 178 | @Override 179 | public String toString() { 180 | StringBuilder sb = new StringBuilder(); 181 | sb.append(EdgeTraversal.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 182 | sb.append("edgeId"); 183 | sb.append('='); 184 | sb.append(((this.edgeId == null)?"":this.edgeId)); 185 | sb.append(','); 186 | sb.append("message"); 187 | sb.append('='); 188 | sb.append(((this.message == null)?"":this.message)); 189 | sb.append(','); 190 | sb.append("finalState"); 191 | sb.append('='); 192 | sb.append(((this.finalState == null)?"":this.finalState)); 193 | sb.append(','); 194 | sb.append("stepOverEdgeCount"); 195 | sb.append('='); 196 | sb.append(((this.stepOverEdgeCount == null)?"":this.stepOverEdgeCount)); 197 | sb.append(','); 198 | sb.append("properties"); 199 | sb.append('='); 200 | sb.append(((this.properties == null)?"":this.properties)); 201 | sb.append(','); 202 | if (sb.charAt((sb.length()- 1)) == ',') { 203 | sb.setCharAt((sb.length()- 1), ']'); 204 | } else { 205 | sb.append(']'); 206 | } 207 | return sb.toString(); 208 | } 209 | 210 | @Override 211 | public int hashCode() { 212 | int result = 1; 213 | result = ((result* 31)+((this.edgeId == null)? 0 :this.edgeId.hashCode())); 214 | result = ((result* 31)+((this.message == null)? 0 :this.message.hashCode())); 215 | result = ((result* 31)+((this.stepOverEdgeCount == null)? 0 :this.stepOverEdgeCount.hashCode())); 216 | result = ((result* 31)+((this.finalState == null)? 0 :this.finalState.hashCode())); 217 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 218 | return result; 219 | } 220 | 221 | @Override 222 | public boolean equals(Object other) { 223 | if (other == this) { 224 | return true; 225 | } 226 | if ((other instanceof EdgeTraversal) == false) { 227 | return false; 228 | } 229 | EdgeTraversal rhs = ((EdgeTraversal) other); 230 | return ((((((this.edgeId == rhs.edgeId)||((this.edgeId!= null)&&this.edgeId.equals(rhs.edgeId)))&&((this.message == rhs.message)||((this.message!= null)&&this.message.equals(rhs.message))))&&((this.stepOverEdgeCount == rhs.stepOverEdgeCount)||((this.stepOverEdgeCount!= null)&&this.stepOverEdgeCount.equals(rhs.stepOverEdgeCount))))&&((this.finalState == rhs.finalState)||((this.finalState!= null)&&this.finalState.equals(rhs.finalState))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 231 | } 232 | 233 | } 234 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ArtifactLocation.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Specifies the location of an artifact. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "uri", 17 | "uriBaseId", 18 | "index", 19 | "description", 20 | "properties" 21 | }) 22 | public class ArtifactLocation { 23 | 24 | /** 25 | * A string containing a valid relative or absolute URI. 26 | * 27 | */ 28 | @JsonProperty("uri") 29 | @JsonPropertyDescription("A string containing a valid relative or absolute URI.") 30 | private String uri; 31 | /** 32 | * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. 33 | * 34 | */ 35 | @JsonProperty("uriBaseId") 36 | @JsonPropertyDescription("A string which indirectly specifies the absolute URI with respect to which a relative URI in the \"uri\" property is interpreted.") 37 | private String uriBaseId; 38 | /** 39 | * The index within the run artifacts array of the artifact object associated with the artifact location. 40 | * 41 | */ 42 | @JsonProperty("index") 43 | @JsonPropertyDescription("The index within the run artifacts array of the artifact object associated with the artifact location.") 44 | private Integer index = -1; 45 | /** 46 | * Encapsulates a message intended to be read by the end user. 47 | * 48 | */ 49 | @JsonProperty("description") 50 | @JsonPropertyDescription("Encapsulates a message intended to be read by the end user.") 51 | private Message description; 52 | /** 53 | * Key/value pairs that provide additional information about the object. 54 | * 55 | */ 56 | @JsonProperty("properties") 57 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 58 | private PropertyBag properties; 59 | 60 | /** 61 | * A string containing a valid relative or absolute URI. 62 | * 63 | */ 64 | @JsonProperty("uri") 65 | public String getUri() { 66 | return uri; 67 | } 68 | 69 | /** 70 | * A string containing a valid relative or absolute URI. 71 | * 72 | */ 73 | @JsonProperty("uri") 74 | public void setUri(String uri) { 75 | this.uri = uri; 76 | } 77 | 78 | public ArtifactLocation withUri(String uri) { 79 | this.uri = uri; 80 | return this; 81 | } 82 | 83 | /** 84 | * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. 85 | * 86 | */ 87 | @JsonProperty("uriBaseId") 88 | public String getUriBaseId() { 89 | return uriBaseId; 90 | } 91 | 92 | /** 93 | * A string which indirectly specifies the absolute URI with respect to which a relative URI in the "uri" property is interpreted. 94 | * 95 | */ 96 | @JsonProperty("uriBaseId") 97 | public void setUriBaseId(String uriBaseId) { 98 | this.uriBaseId = uriBaseId; 99 | } 100 | 101 | public ArtifactLocation withUriBaseId(String uriBaseId) { 102 | this.uriBaseId = uriBaseId; 103 | return this; 104 | } 105 | 106 | /** 107 | * The index within the run artifacts array of the artifact object associated with the artifact location. 108 | * 109 | */ 110 | @JsonProperty("index") 111 | public Integer getIndex() { 112 | return index; 113 | } 114 | 115 | /** 116 | * The index within the run artifacts array of the artifact object associated with the artifact location. 117 | * 118 | */ 119 | @JsonProperty("index") 120 | public void setIndex(Integer index) { 121 | this.index = index; 122 | } 123 | 124 | public ArtifactLocation withIndex(Integer index) { 125 | this.index = index; 126 | return this; 127 | } 128 | 129 | /** 130 | * Encapsulates a message intended to be read by the end user. 131 | * 132 | */ 133 | @JsonProperty("description") 134 | public Message getDescription() { 135 | return description; 136 | } 137 | 138 | /** 139 | * Encapsulates a message intended to be read by the end user. 140 | * 141 | */ 142 | @JsonProperty("description") 143 | public void setDescription(Message description) { 144 | this.description = description; 145 | } 146 | 147 | public ArtifactLocation withDescription(Message description) { 148 | this.description = description; 149 | return this; 150 | } 151 | 152 | /** 153 | * Key/value pairs that provide additional information about the object. 154 | * 155 | */ 156 | @JsonProperty("properties") 157 | public PropertyBag getProperties() { 158 | return properties; 159 | } 160 | 161 | /** 162 | * Key/value pairs that provide additional information about the object. 163 | * 164 | */ 165 | @JsonProperty("properties") 166 | public void setProperties(PropertyBag properties) { 167 | this.properties = properties; 168 | } 169 | 170 | public ArtifactLocation withProperties(PropertyBag properties) { 171 | this.properties = properties; 172 | return this; 173 | } 174 | 175 | @Override 176 | public String toString() { 177 | StringBuilder sb = new StringBuilder(); 178 | sb.append(ArtifactLocation.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 179 | sb.append("uri"); 180 | sb.append('='); 181 | sb.append(((this.uri == null)?"":this.uri)); 182 | sb.append(','); 183 | sb.append("uriBaseId"); 184 | sb.append('='); 185 | sb.append(((this.uriBaseId == null)?"":this.uriBaseId)); 186 | sb.append(','); 187 | sb.append("index"); 188 | sb.append('='); 189 | sb.append(((this.index == null)?"":this.index)); 190 | sb.append(','); 191 | sb.append("description"); 192 | sb.append('='); 193 | sb.append(((this.description == null)?"":this.description)); 194 | sb.append(','); 195 | sb.append("properties"); 196 | sb.append('='); 197 | sb.append(((this.properties == null)?"":this.properties)); 198 | sb.append(','); 199 | if (sb.charAt((sb.length()- 1)) == ',') { 200 | sb.setCharAt((sb.length()- 1), ']'); 201 | } else { 202 | sb.append(']'); 203 | } 204 | return sb.toString(); 205 | } 206 | 207 | @Override 208 | public int hashCode() { 209 | int result = 1; 210 | result = ((result* 31)+((this.index == null)? 0 :this.index.hashCode())); 211 | result = ((result* 31)+((this.description == null)? 0 :this.description.hashCode())); 212 | result = ((result* 31)+((this.uri == null)? 0 :this.uri.hashCode())); 213 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 214 | result = ((result* 31)+((this.uriBaseId == null)? 0 :this.uriBaseId.hashCode())); 215 | return result; 216 | } 217 | 218 | @Override 219 | public boolean equals(Object other) { 220 | if (other == this) { 221 | return true; 222 | } 223 | if ((other instanceof ArtifactLocation) == false) { 224 | return false; 225 | } 226 | ArtifactLocation rhs = ((ArtifactLocation) other); 227 | return ((((((this.index == rhs.index)||((this.index!= null)&&this.index.equals(rhs.index)))&&((this.description == rhs.description)||((this.description!= null)&&this.description.equals(rhs.description))))&&((this.uri == rhs.uri)||((this.uri!= null)&&this.uri.equals(rhs.uri))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties))))&&((this.uriBaseId == rhs.uriBaseId)||((this.uriBaseId!= null)&&this.uriBaseId.equals(rhs.uriBaseId)))); 228 | } 229 | 230 | } 231 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/Exception.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import java.util.List; 5 | import com.fasterxml.jackson.annotation.JsonInclude; 6 | import com.fasterxml.jackson.annotation.JsonProperty; 7 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 8 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 9 | 10 | 11 | /** 12 | * Describes a runtime exception encountered during the execution of an analysis tool. 13 | * 14 | */ 15 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 16 | @JsonPropertyOrder({ 17 | "kind", 18 | "message", 19 | "stack", 20 | "innerExceptions", 21 | "properties" 22 | }) 23 | public class Exception { 24 | 25 | /** 26 | * A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. 27 | * 28 | */ 29 | @JsonProperty("kind") 30 | @JsonPropertyDescription("A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal.") 31 | private String kind; 32 | /** 33 | * A message that describes the exception. 34 | * 35 | */ 36 | @JsonProperty("message") 37 | @JsonPropertyDescription("A message that describes the exception.") 38 | private String message; 39 | /** 40 | * A call stack that is relevant to a result. 41 | * 42 | */ 43 | @JsonProperty("stack") 44 | @JsonPropertyDescription("A call stack that is relevant to a result.") 45 | private Stack stack; 46 | /** 47 | * An array of exception objects each of which is considered a cause of this exception. 48 | * 49 | */ 50 | @JsonProperty("innerExceptions") 51 | @JsonPropertyDescription("An array of exception objects each of which is considered a cause of this exception.") 52 | private List innerExceptions = null; 53 | /** 54 | * Key/value pairs that provide additional information about the object. 55 | * 56 | */ 57 | @JsonProperty("properties") 58 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 59 | private PropertyBag properties; 60 | 61 | /** 62 | * A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. 63 | * 64 | */ 65 | @JsonProperty("kind") 66 | public String getKind() { 67 | return kind; 68 | } 69 | 70 | /** 71 | * A string that identifies the kind of exception, for example, the fully qualified type name of an object that was thrown, or the symbolic name of a signal. 72 | * 73 | */ 74 | @JsonProperty("kind") 75 | public void setKind(String kind) { 76 | this.kind = kind; 77 | } 78 | 79 | public Exception withKind(String kind) { 80 | this.kind = kind; 81 | return this; 82 | } 83 | 84 | /** 85 | * A message that describes the exception. 86 | * 87 | */ 88 | @JsonProperty("message") 89 | public String getMessage() { 90 | return message; 91 | } 92 | 93 | /** 94 | * A message that describes the exception. 95 | * 96 | */ 97 | @JsonProperty("message") 98 | public void setMessage(String message) { 99 | this.message = message; 100 | } 101 | 102 | public Exception withMessage(String message) { 103 | this.message = message; 104 | return this; 105 | } 106 | 107 | /** 108 | * A call stack that is relevant to a result. 109 | * 110 | */ 111 | @JsonProperty("stack") 112 | public Stack getStack() { 113 | return stack; 114 | } 115 | 116 | /** 117 | * A call stack that is relevant to a result. 118 | * 119 | */ 120 | @JsonProperty("stack") 121 | public void setStack(Stack stack) { 122 | this.stack = stack; 123 | } 124 | 125 | public Exception withStack(Stack stack) { 126 | this.stack = stack; 127 | return this; 128 | } 129 | 130 | /** 131 | * An array of exception objects each of which is considered a cause of this exception. 132 | * 133 | */ 134 | @JsonProperty("innerExceptions") 135 | public List getInnerExceptions() { 136 | return innerExceptions; 137 | } 138 | 139 | /** 140 | * An array of exception objects each of which is considered a cause of this exception. 141 | * 142 | */ 143 | @JsonProperty("innerExceptions") 144 | public void setInnerExceptions(List innerExceptions) { 145 | this.innerExceptions = innerExceptions; 146 | } 147 | 148 | public Exception withInnerExceptions(List innerExceptions) { 149 | this.innerExceptions = innerExceptions; 150 | return this; 151 | } 152 | 153 | /** 154 | * Key/value pairs that provide additional information about the object. 155 | * 156 | */ 157 | @JsonProperty("properties") 158 | public PropertyBag getProperties() { 159 | return properties; 160 | } 161 | 162 | /** 163 | * Key/value pairs that provide additional information about the object. 164 | * 165 | */ 166 | @JsonProperty("properties") 167 | public void setProperties(PropertyBag properties) { 168 | this.properties = properties; 169 | } 170 | 171 | public Exception withProperties(PropertyBag properties) { 172 | this.properties = properties; 173 | return this; 174 | } 175 | 176 | @Override 177 | public String toString() { 178 | StringBuilder sb = new StringBuilder(); 179 | sb.append(Exception.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 180 | sb.append("kind"); 181 | sb.append('='); 182 | sb.append(((this.kind == null)?"":this.kind)); 183 | sb.append(','); 184 | sb.append("message"); 185 | sb.append('='); 186 | sb.append(((this.message == null)?"":this.message)); 187 | sb.append(','); 188 | sb.append("stack"); 189 | sb.append('='); 190 | sb.append(((this.stack == null)?"":this.stack)); 191 | sb.append(','); 192 | sb.append("innerExceptions"); 193 | sb.append('='); 194 | sb.append(((this.innerExceptions == null)?"":this.innerExceptions)); 195 | sb.append(','); 196 | sb.append("properties"); 197 | sb.append('='); 198 | sb.append(((this.properties == null)?"":this.properties)); 199 | sb.append(','); 200 | if (sb.charAt((sb.length()- 1)) == ',') { 201 | sb.setCharAt((sb.length()- 1), ']'); 202 | } else { 203 | sb.append(']'); 204 | } 205 | return sb.toString(); 206 | } 207 | 208 | @Override 209 | public int hashCode() { 210 | int result = 1; 211 | result = ((result* 31)+((this.stack == null)? 0 :this.stack.hashCode())); 212 | result = ((result* 31)+((this.innerExceptions == null)? 0 :this.innerExceptions.hashCode())); 213 | result = ((result* 31)+((this.message == null)? 0 :this.message.hashCode())); 214 | result = ((result* 31)+((this.kind == null)? 0 :this.kind.hashCode())); 215 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 216 | return result; 217 | } 218 | 219 | @Override 220 | public boolean equals(Object other) { 221 | if (other == this) { 222 | return true; 223 | } 224 | if ((other instanceof Exception) == false) { 225 | return false; 226 | } 227 | Exception rhs = ((Exception) other); 228 | return ((((((this.stack == rhs.stack)||((this.stack!= null)&&this.stack.equals(rhs.stack)))&&((this.innerExceptions == rhs.innerExceptions)||((this.innerExceptions!= null)&&this.innerExceptions.equals(rhs.innerExceptions))))&&((this.message == rhs.message)||((this.message!= null)&&this.message.equals(rhs.message))))&&((this.kind == rhs.kind)||((this.kind!= null)&&this.kind.equals(rhs.kind))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 229 | } 230 | 231 | } 232 | -------------------------------------------------------------------------------- /src/main/java/com/contrastsecurity/sarif/ReportingDescriptorReference.java: -------------------------------------------------------------------------------- 1 | 2 | package com.contrastsecurity.sarif; 3 | 4 | import com.fasterxml.jackson.annotation.JsonInclude; 5 | import com.fasterxml.jackson.annotation.JsonProperty; 6 | import com.fasterxml.jackson.annotation.JsonPropertyDescription; 7 | import com.fasterxml.jackson.annotation.JsonPropertyOrder; 8 | 9 | 10 | /** 11 | * Information about how to locate a relevant reporting descriptor. 12 | * 13 | */ 14 | @JsonInclude(JsonInclude.Include.NON_DEFAULT) 15 | @JsonPropertyOrder({ 16 | "id", 17 | "index", 18 | "guid", 19 | "toolComponent", 20 | "properties" 21 | }) 22 | public class ReportingDescriptorReference { 23 | 24 | /** 25 | * The id of the descriptor. 26 | * 27 | */ 28 | @JsonProperty("id") 29 | @JsonPropertyDescription("The id of the descriptor.") 30 | private String id; 31 | /** 32 | * The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. 33 | * 34 | */ 35 | @JsonProperty("index") 36 | @JsonPropertyDescription("The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context.") 37 | private Integer index = -1; 38 | /** 39 | * A guid that uniquely identifies the descriptor. 40 | * 41 | */ 42 | @JsonProperty("guid") 43 | @JsonPropertyDescription("A guid that uniquely identifies the descriptor.") 44 | private String guid; 45 | /** 46 | * Identifies a particular toolComponent object, either the driver or an extension. 47 | * 48 | */ 49 | @JsonProperty("toolComponent") 50 | @JsonPropertyDescription("Identifies a particular toolComponent object, either the driver or an extension.") 51 | private ToolComponentReference toolComponent; 52 | /** 53 | * Key/value pairs that provide additional information about the object. 54 | * 55 | */ 56 | @JsonProperty("properties") 57 | @JsonPropertyDescription("Key/value pairs that provide additional information about the object.") 58 | private PropertyBag properties; 59 | 60 | /** 61 | * The id of the descriptor. 62 | * 63 | */ 64 | @JsonProperty("id") 65 | public String getId() { 66 | return id; 67 | } 68 | 69 | /** 70 | * The id of the descriptor. 71 | * 72 | */ 73 | @JsonProperty("id") 74 | public void setId(String id) { 75 | this.id = id; 76 | } 77 | 78 | public ReportingDescriptorReference withId(String id) { 79 | this.id = id; 80 | return this; 81 | } 82 | 83 | /** 84 | * The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. 85 | * 86 | */ 87 | @JsonProperty("index") 88 | public Integer getIndex() { 89 | return index; 90 | } 91 | 92 | /** 93 | * The index into an array of descriptors in toolComponent.ruleDescriptors, toolComponent.notificationDescriptors, or toolComponent.taxonomyDescriptors, depending on context. 94 | * 95 | */ 96 | @JsonProperty("index") 97 | public void setIndex(Integer index) { 98 | this.index = index; 99 | } 100 | 101 | public ReportingDescriptorReference withIndex(Integer index) { 102 | this.index = index; 103 | return this; 104 | } 105 | 106 | /** 107 | * A guid that uniquely identifies the descriptor. 108 | * 109 | */ 110 | @JsonProperty("guid") 111 | public String getGuid() { 112 | return guid; 113 | } 114 | 115 | /** 116 | * A guid that uniquely identifies the descriptor. 117 | * 118 | */ 119 | @JsonProperty("guid") 120 | public void setGuid(String guid) { 121 | this.guid = guid; 122 | } 123 | 124 | public ReportingDescriptorReference withGuid(String guid) { 125 | this.guid = guid; 126 | return this; 127 | } 128 | 129 | /** 130 | * Identifies a particular toolComponent object, either the driver or an extension. 131 | * 132 | */ 133 | @JsonProperty("toolComponent") 134 | public ToolComponentReference getToolComponent() { 135 | return toolComponent; 136 | } 137 | 138 | /** 139 | * Identifies a particular toolComponent object, either the driver or an extension. 140 | * 141 | */ 142 | @JsonProperty("toolComponent") 143 | public void setToolComponent(ToolComponentReference toolComponent) { 144 | this.toolComponent = toolComponent; 145 | } 146 | 147 | public ReportingDescriptorReference withToolComponent(ToolComponentReference toolComponent) { 148 | this.toolComponent = toolComponent; 149 | return this; 150 | } 151 | 152 | /** 153 | * Key/value pairs that provide additional information about the object. 154 | * 155 | */ 156 | @JsonProperty("properties") 157 | public PropertyBag getProperties() { 158 | return properties; 159 | } 160 | 161 | /** 162 | * Key/value pairs that provide additional information about the object. 163 | * 164 | */ 165 | @JsonProperty("properties") 166 | public void setProperties(PropertyBag properties) { 167 | this.properties = properties; 168 | } 169 | 170 | public ReportingDescriptorReference withProperties(PropertyBag properties) { 171 | this.properties = properties; 172 | return this; 173 | } 174 | 175 | @Override 176 | public String toString() { 177 | StringBuilder sb = new StringBuilder(); 178 | sb.append(ReportingDescriptorReference.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('['); 179 | sb.append("id"); 180 | sb.append('='); 181 | sb.append(((this.id == null)?"":this.id)); 182 | sb.append(','); 183 | sb.append("index"); 184 | sb.append('='); 185 | sb.append(((this.index == null)?"":this.index)); 186 | sb.append(','); 187 | sb.append("guid"); 188 | sb.append('='); 189 | sb.append(((this.guid == null)?"":this.guid)); 190 | sb.append(','); 191 | sb.append("toolComponent"); 192 | sb.append('='); 193 | sb.append(((this.toolComponent == null)?"":this.toolComponent)); 194 | sb.append(','); 195 | sb.append("properties"); 196 | sb.append('='); 197 | sb.append(((this.properties == null)?"":this.properties)); 198 | sb.append(','); 199 | if (sb.charAt((sb.length()- 1)) == ',') { 200 | sb.setCharAt((sb.length()- 1), ']'); 201 | } else { 202 | sb.append(']'); 203 | } 204 | return sb.toString(); 205 | } 206 | 207 | @Override 208 | public int hashCode() { 209 | int result = 1; 210 | result = ((result* 31)+((this.index == null)? 0 :this.index.hashCode())); 211 | result = ((result* 31)+((this.guid == null)? 0 :this.guid.hashCode())); 212 | result = ((result* 31)+((this.toolComponent == null)? 0 :this.toolComponent.hashCode())); 213 | result = ((result* 31)+((this.id == null)? 0 :this.id.hashCode())); 214 | result = ((result* 31)+((this.properties == null)? 0 :this.properties.hashCode())); 215 | return result; 216 | } 217 | 218 | @Override 219 | public boolean equals(Object other) { 220 | if (other == this) { 221 | return true; 222 | } 223 | if ((other instanceof ReportingDescriptorReference) == false) { 224 | return false; 225 | } 226 | ReportingDescriptorReference rhs = ((ReportingDescriptorReference) other); 227 | return ((((((this.index == rhs.index)||((this.index!= null)&&this.index.equals(rhs.index)))&&((this.guid == rhs.guid)||((this.guid!= null)&&this.guid.equals(rhs.guid))))&&((this.toolComponent == rhs.toolComponent)||((this.toolComponent!= null)&&this.toolComponent.equals(rhs.toolComponent))))&&((this.id == rhs.id)||((this.id!= null)&&this.id.equals(rhs.id))))&&((this.properties == rhs.properties)||((this.properties!= null)&&this.properties.equals(rhs.properties)))); 228 | } 229 | 230 | } 231 | --------------------------------------------------------------------------------