// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.sps.data;

import com.google.common.collect.ImmutableSet;
import java.util.Set;

/**
 * Object for holding the analysis results served by ReceiptAnalysisServlet.
 */
public class AnalysisResults {
  private final String rawText;
  private final ImmutableSet<String> categories;

  public AnalysisResults(String rawText, Set<String> categories) {
    this.rawText = rawText;
    this.categories = ImmutableSet.copyOf(categories);
  }

  public String getRawText() {
    return rawText;
  }

  public ImmutableSet<String> getCategories() {
    return categories;
  }
}
@@ -659,16 +659,43 @@
 bleSet;%0A
+import java.util.Optional;%0A
 import j
@@ -905,16 +905,56 @@
 egories;
+%0A  private final Optional%3CString%3E store;
 %0A%0A  publ
@@ -1010,16 +1010,40 @@
 tegories
+, Optional%3CString%3E store
 ) %7B%0A    
@@ -1121,16 +1121,40 @@
 ories);%0A
+    this.store = store;%0A
   %7D%0A%0A  p
@@ -1280,10 +1280,786 @@
 ies;%0A  %7D
+%0A%0A  public static class Builder %7B%0A    private final String rawText;%0A    private ImmutableSet%3CString%3E categories;%0A    private Optional%3CString%3E store;%0A%0A    public Builder(String rawText) %7B%0A      this.rawText = rawText;%0A    %7D%0A%0A    public String getRawText() %7B%0A      return this.rawText;%0A    %7D%0A%0A    public Builder setCategories(Set%3CString%3E categories) %7B%0A      this.categories = ImmutableSet.copyOf(categories);%0A      return this;%0A    %7D%0A%0A    public Builder setStore(String store) %7B%0A      this.store = Optional.of(store);%0A      return this;%0A    %7D%0A%0A    public AnalysisResults build() %7B%0A      // No logo was detected.%0A      if (this.store == null) %7B%0A        this.store = Optional.empty();%0A      %7D%0A%0A      return new AnalysisResults(this.rawText, this.categories, this.store);%0A    %7D%0A  %7D
 %0A%7D

Add store field and builder to AnalysisResults class.