@@ -602,8 +602,14 @@ private Configuration(Builder builder) {
602602
603603 /** Allows for simple constructing of a {@code Configuration} object. */
604604 public static final class Builder {
605+ /**
606+ * The default maximum number of bytes to use for the Parse cache on disk.
607+ */
605608 public static final int DEFAULT_MAX_KEY_VALUE_CACHE_BYTES =
606609 ParseKeyValueCache .DEFAULT_MAX_KEY_VALUE_CACHE_BYTES ;
610+ /**
611+ * The default maximum number of files to store in the Parse cache on disk.
612+ */
607613 public static final int DEFAULT_MAX_KEY_VALUE_CACHE_FILES =
608614 ParseKeyValueCache .DEFAULT_MAX_KEY_VALUE_CACHE_FILES ;
609615 private final Context context ;
@@ -727,6 +733,9 @@ public Builder maxRetries(int maxRetries) {
727733 * @return The same builder, for easy chaining.
728734 */
729735 public Builder maxKeyValueCacheBytes (int maxKeyValueCacheBytes ) {
736+ if (maxKeyValueCacheBytes < 0 ) {
737+ throw new IllegalArgumentException ("maxKeyValueCacheBytes must be >= 0" );
738+ }
730739 this .maxKeyValueCacheBytes = maxKeyValueCacheBytes ;
731740 return this ;
732741 }
@@ -739,6 +748,9 @@ public Builder maxKeyValueCacheBytes(int maxKeyValueCacheBytes) {
739748 * @return The same builder, for easy chaining.
740749 */
741750 public Builder maxKeyValueCacheFiles (int maxKeyValueCacheFiles ) {
751+ if (maxKeyValueCacheFiles < 0 ) {
752+ throw new IllegalArgumentException ("maxKeyValueCacheFiles must be >= 0" );
753+ }
742754 this .maxKeyValueCacheFiles = maxKeyValueCacheFiles ;
743755 return this ;
744756 }
0 commit comments