@@ -0,0 +1,2855 @@
+// Copyright 2020 Google LLC%0A//%0A// Licensed under the Apache License, Version 2.0 (the %22License%22);%0A// you may not use this file except in compliance with the License.%0A// You may obtain a copy of the License at%0A//%0A//     https://www.apache.org/licenses/LICENSE-2.0%0A//%0A// Unless required by applicable law or agreed to in writing, software%0A// distributed under the License is distributed on an %22AS IS%22 BASIS,%0A// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A// See the License for the specific language governing permissions and%0A// limitations under the License.%0A%0Apackage com.google.sps.storage;%0A%0A/**%0A * An immutable container used for providing stripped-down build bot information%0A * to the StorageController. Provides functionality for checking whether the information%0A * is sufficient for either a creation or an update of an entry. Does not modify or%0A * validity checks the individual contents of each field.%0A */%0Apublic class ParsedBuildbotData %7B%0A  private final String commitHash;%0A  private final String timestamp;%0A  private final String branch;%0A  private final String builderName;%0A  private final List%3CString%3E logs;%0A  private final boolean status;%0A%0A  /**%0A   * Creates an instance with sufficient information for creating a database entry.%0A   */%0A  public ParsedBuildbotData(final String commitHash, final String timestamp, final String branch) %7B%0A    this.commitHash = commitHash;%0A    this.timestamp = timestamp;%0A    this.branch = branch;%0A    this.builderName = null;%0A    this.logs = null;%0A    this.status = null;%0A  %7D%0A%0A  /**%0A   * Creates an instance with sufficient information for updating a database entry.%0A   */%0A  public ParsedBuildbotData(final String commitHash, final String timestamp, final String branch,%0A                        final String builderName, final List%3CString%3E logs, final boolean status) %7B%0A    this.commitHash = commitHash;%0A    this.timestamp = timestamp;%0A    this.branch = branch;%0A    this.builderName = builderName;%0A    this.logs = new ArrayList%3C%3E(logs);%0A    this.status = status;%0A  %7D%0A%0A  /**%0A   * Checks for the existance of the fields necessary for creating a database entry.%0A   * Does not check the validity of each field.%0A   */%0A  boolean validCreationData() %7B%0A    return (commitHash != null && timestamp != null && branch != null);%0A  %7D%0A%0A  /**%0A   * Checks for the existance of the fields necessary for updating a database entry.%0A   * Does not check the validity of each field.%0A   */%0A  boolean validUpdateData() %7B%0A    return (commitHash != null && builderName != null && logs != null);%0A  %7D%0A%0A  String getCommitHash() %7B%0A    return commitHash;%0A  %7D%0A%0A  String getTimestamp() %7B%0A    return timestamp;%0A  %7D%0A%0A  String getBranch() %7B%0A    return branch;%0A  %7D%0A%0A  String getBuilderName() %7B%0A    return builderName;%0A  %7D%0A%0A  List%3CString%3E getLogs() %7B%0A    return logs;%0A  %7D%0A%0A  boolean getStatus() %7B%0A    return status;%0A  %7D%0A%7D%0A

add ParsedBuildbotData POJO