1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.chrome.browser.feed.library.api.host.storage; 6 7 import androidx.annotation.IntDef; 8 9 /** Status after completion of a commit to storage. */ 10 public final class CommitResult { 11 /** IntDef that defines result values. */ 12 @IntDef({Result.SUCCESS, Result.FAILURE}) 13 public @interface Result { 14 int SUCCESS = 0; 15 int FAILURE = 1; 16 } 17 getResult()18 public @Result int getResult() { 19 return mResult; 20 } 21 22 private final @Result int mResult; 23 24 // Private constructor - use static instances CommitResult(@esult int result)25 private CommitResult(@Result int result) { 26 this.mResult = result; 27 } 28 29 public static final CommitResult SUCCESS = new CommitResult(Result.SUCCESS); 30 public static final CommitResult FAILURE = new CommitResult(Result.FAILURE); 31 } 32