Fix few code issues
[transportpce.git] / servicehandler / src / main / java / org / opendaylight / transportpce / servicehandler / validation / checks / ComplianceCheckResult.java
1 /*
2  * Copyright © 2017 Orange, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.transportpce.servicehandler.validation.checks;
9 import org.slf4j.Logger;
10 import org.slf4j.LoggerFactory;
11
12 public class ComplianceCheckResult {
13
14     private static final Logger LOG = LoggerFactory.getLogger(ComplianceCheckResult.class);
15
16     private boolean passed;
17     private String message;
18
19     public ComplianceCheckResult(boolean result) {
20         this.passed = result;
21         this.message = "";
22     }
23
24     public ComplianceCheckResult(boolean passed, String message) {
25         if (passed) {
26             LOG.debug("Compliance check passed");
27         } else {
28             LOG.debug("Compliance check: {}", message);
29         }
30         this.passed = passed;
31         this.message = message;
32     }
33
34     public String getMessage() {
35         return message;
36     }
37
38     public boolean hasPassed() {
39         return passed;
40     }
41
42 }