4f19d6c3c457cf213135ab7d42213c4ba8e92e97
[transportpce.git] / tapi / src / main / java / org / opendaylight / transportpce / tapi / validation / checks / ResilienceConstraintCheck.java
1 /*
2  * Copyright © 2018 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.tapi.validation.checks;
9
10 import org.opendaylight.transportpce.servicehandler.validation.checks.ComplianceCheckResult;
11 import org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.connectivity.rev181210.create.connectivity.service.input.ResilienceConstraint;
12
13 public final class ResilienceConstraintCheck {
14
15     private ResilienceConstraintCheck() {
16     }
17
18     public static boolean checkString(String value) {
19         return ((value != null) && (value.compareTo("") != 0));
20     }
21
22     public static ComplianceCheckResult check(ResilienceConstraint rcl) {
23         boolean result = true;
24         String message = "";
25
26         if (rcl != null) {
27             result = false;
28             message = "Resilience constraints are not managet yet";
29         }
30
31         return new ComplianceCheckResult(result, message);
32     }
33 }