2 * Copyright (c) 2014 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
9 package org.opendaylight.groupbasedpolicy.renderer.ofoverlay.sf;
11 import java.util.List;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.flow.MatchBuilder;
15 import com.google.common.base.Preconditions;
17 public class ClassificationResult {
19 private final String message;
20 private final boolean isSuccessful;
21 private final List<MatchBuilder> matchBuilders;
23 public ClassificationResult(String errorMessage) {
24 this.message = Preconditions.checkNotNull(errorMessage);
25 this.isSuccessful = false;
29 public ClassificationResult(List<MatchBuilder> matches) {
31 this.matchBuilders = Preconditions.checkNotNull(matches);
32 this.isSuccessful = true;
35 public List<MatchBuilder> getMatchBuilders() {
36 if (isSuccessful == false) {
37 throw new IllegalStateException("Classification was not successfull.");
42 public String getMessage() {
46 public boolean isSuccessfull() {