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.iovisor.sf;
11 import java.util.List;
13 import com.google.common.base.Preconditions;
15 public class ClassificationResult {
17 static final String DEFAULT_ERROR_MESSAGE = "";
18 private final String errorMessage;
19 private final boolean isSuccessful;
22 * @param errorMessage cannot be {@code null}
24 public ClassificationResult(String errorMessage) {
25 this.errorMessage = Preconditions.checkNotNull(errorMessage);
26 this.isSuccessful = false;
30 * @param matches cannot be {@code null}
32 public ClassificationResult(List<String> matches) {
33 errorMessage = DEFAULT_ERROR_MESSAGE;
34 this.isSuccessful = true;
38 * @return contains error message if {@link #isSuccessfull()} == {@code false}
40 public String getErrorMessage() {
45 * @return {@code true} if {@link ClassificationResult} contains result. {@code false} if
46 * {@link ClassificationResult} contains error message.
48 public boolean isSuccessfull() {