add a common folder for mutualized functions
[transportpce.git] / common / src / main / java / org / opendaylight / transportpce / common / OperationResult.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.common;
9
10 public class OperationResult {
11
12     private final boolean success;
13     private final String resultMessage;
14
15     protected OperationResult(boolean success, String resultMessage) {
16         this.success = success;
17         this.resultMessage = resultMessage;
18     }
19
20     public boolean isSuccess() {
21         return success;
22     }
23
24     public String getResultMessage() {
25         return resultMessage;
26     }
27
28     public static OperationResult failed(String message) {
29         return new OperationResult(false, message);
30     }
31
32     public static OperationResult ok(String message) {
33         return new OperationResult(true, message);
34     }
35
36 }