package com.nikita.recipiesapp.common;


import com.nikita.recipiesapp.common.models.Recipe;

import java.util.List;

public final class AppState {
  public final List<Recipe> recipes;

  private final String selectedRecipeId;
  private final String selectedStepId;

  public AppState(List<Recipe> recipes,
                  String selectedRecipeId,
                  String selectedStepId) {
    this.recipes = recipes;
    this.selectedRecipeId = selectedRecipeId;
    this.selectedStepId = selectedStepId;
  }
}

@@ -45,107 +45,410 @@
 ort 
-com.nikita.recipiesapp.common.models.Recipe;%0A%0Aimport java.util.List;%0A%0Apublic final class AppState %7B
+android.support.annotation.NonNull;%0Aimport android.support.annotation.Nullable;%0A%0Aimport com.nikita.recipiesapp.common.models.Recipe;%0Aimport com.nikita.recipiesapp.common.models.Step;%0A%0Aimport java.util.Collections;%0Aimport java.util.List;%0A%0Apublic final class AppState %7B%0A  public final boolean isLoading;%0A  @Nullable%0A  public final String notification;%0A  @Nullable%0A  public final String error;%0A%0A  @NonNull
 %0A  p
@@ -482,16 +482,27 @@
 cipes;%0A%0A
+  @NonNull%0A
   privat
@@ -534,16 +534,27 @@
 cipeId;%0A
+  @NonNull%0A
   privat
@@ -603,16 +603,124 @@
 ppState(
+boolean isLoading,%0A                  String notification,%0A                  String error,%0A                  
 List%3CRec
@@ -819,16 +819,110 @@
 epId) %7B%0A
+    this.isLoading = isLoading;%0A    this.notification = notification;%0A    this.error = error;%0A
     this
@@ -1032,11 +1032,1480 @@
 pId;%0A  %7D
+%0A%0A  public static AppState create(boolean isLoading,%0A                                String notification,%0A                                String error,%0A                                List%3CRecipe%3E recipes,%0A                                String selectedRecipeId,%0A                                String selectedStepId) %7B%0A    return new AppState(isLoading, notification, error, recipes, selectedRecipeId, selectedStepId);%0A  %7D%0A%0A  public static AppState initial() %7B%0A    return create(true, null, null, Collections.emptyList(), %22%22, %22%22);%0A  %7D%0A%0A  public AppState withLoading(boolean isLoading) %7B%0A    return create(isLoading, notification, error, recipes, selectedRecipeId, selectedStepId);%0A  %7D%0A%0A  public AppState withNotification(@NonNull String notification) %7B%0A    return create(isLoading, notification, error, recipes, selectedRecipeId, selectedStepId);%0A  %7D%0A%0A  public AppState withError(@NonNull String error) %7B%0A    return create(isLoading, notification, error, recipes, selectedRecipeId, selectedStepId);%0A  %7D%0A%0A  public AppState withRecipes(@NonNull List%3CRecipe%3E recipes) %7B%0A    return create(isLoading, notification, error, recipes, selectedRecipeId, selectedStepId);%0A  %7D%0A%0A  public AppState withSelectedRecipe(@NonNull Recipe recipe) %7B%0A    return create(isLoading, notification, error, recipes, recipe.id, selectedStepId);%0A  %7D%0A%0A  public AppState withSelectedStep(@NonNull Step step) %7B%0A    return create(isLoading, notification, error, recipes, selectedRecipeId, step.id);%0A  %7D
 %0A%7D%0A

Add app state mutation methods