blob: ce3f4aafcd3987aead2359a53aea7d6011c4954f [file] [log] [blame]
Madan Jampani08706ce2015-04-01 14:49:28 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Madan Jampani08706ce2015-04-01 14:49:28 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.store.service;
17
Madan Jampani538be742016-02-10 14:55:38 -080018import org.onosproject.store.primitives.DistributedPrimitiveBuilder;
Madan Jampanie8af1cc2015-06-23 14:23:31 -070019
Madan Jampani08706ce2015-04-01 14:49:28 -070020/**
21 * Builder for distributed set.
22 *
23 * @param <E> type set elements.
24 */
Madan Jampani538be742016-02-10 14:55:38 -080025public abstract class DistributedSetBuilder<E> extends DistributedPrimitiveBuilder<DistributedSetBuilder<E>,
26 AsyncDistributedSet<E>> {
27
28 private boolean purgeOnUninstall = false;
29
30 public DistributedSetBuilder() {
31 super(DistributedPrimitive.Type.SET);
32 }
Madan Jampani08706ce2015-04-01 14:49:28 -070033
34 /**
Madan Jampani538be742016-02-10 14:55:38 -080035 * Enables clearing set contents when the owning application is uninstalled.
Madan Jampani08706ce2015-04-01 14:49:28 -070036 *
Thomas Vachuska708d3032016-02-18 11:11:46 -080037 * @return this builder
Madan Jampani08706ce2015-04-01 14:49:28 -070038 */
Madan Jampani538be742016-02-10 14:55:38 -080039 public DistributedSetBuilder<E> withPurgeOnUninstall() {
40 purgeOnUninstall = true;
41 return this;
42 }
Madan Jampani08706ce2015-04-01 14:49:28 -070043
44 /**
Madan Jampani538be742016-02-10 14:55:38 -080045 * Returns if set contents need to be cleared when owning application is uninstalled.
46 * @return {@code true} if yes; {@code false} otherwise.
Madan Jampanie8af1cc2015-06-23 14:23:31 -070047 */
Madan Jampani538be742016-02-10 14:55:38 -080048 public boolean purgeOnUninstall() {
49 return purgeOnUninstall;
50 }
Sho SHIMIZU3310a342015-05-13 12:14:05 -070051}