2 * Copyright (c) 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.statistics.flowcache;
10 import java.util.ArrayList;
11 import java.util.List;
13 import com.google.common.base.Joiner;
14 import com.google.common.base.Preconditions;
16 public final class FlowCacheKeys {
18 private static final String SEPARATOR = ",";
22 private FlowCacheKeys(FlowCacheKeysBuilder builder) {
23 this.value = Joiner.on(SEPARATOR).join(builder.getValues());
26 public String getValue() {
30 public static FlowCacheKeysBuilder builder(){
31 return new FlowCacheKeysBuilder();
34 public static class FlowCacheKeysBuilder {
36 private List<String> values = new ArrayList<>();
38 public List<String> getValues() {
42 public FlowCacheKeysBuilder setValues(List<String> values) {
43 this.values = Preconditions.checkNotNull(values);
47 public FlowCacheKeysBuilder addValue(String value) {
48 values.add(Preconditions.checkNotNull(value));
52 public FlowCacheKeys build() {
53 return new FlowCacheKeys(this);