blob: feaa709e5e48eaec7c7d93cd0b9602b16479e7d1 [file] [log] [blame]
lishuai91d986c2015-07-28 09:45:20 +08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
lishuai91d986c2015-07-28 09:45:20 +08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.ovsdb.rfc.operations;
17
18import static com.google.common.base.Preconditions.checkNotNull;
19
20import org.onosproject.ovsdb.rfc.schema.TableSchema;
21
22/**
23 * assert operation.Refer to RFC 7047 Section 5.2.
24 */
25public final class Assert implements Operation {
26
27 private final String op;
28 private final String lock;
29
30 /**
31 * Constructs a Assert object.
32 * @param lock the lock member of assert operation
33 */
34 public Assert(String lock) {
lishuai2f197432015-07-31 16:27:58 +080035 checkNotNull(lock, "lock cannot be null");
lishuai91d986c2015-07-28 09:45:20 +080036 this.op = Operations.ASSERT.op();
37 this.lock = lock;
38 }
39
40 /**
41 * Returns the lock member of assert operation.
42 * @return the lock member of assert operation
43 */
44 public String getLock() {
45 return lock;
46 }
47
48 @Override
49 public String getOp() {
50 return op;
51 }
52
53 @Override
54 public TableSchema getTableSchema() {
55 return null;
56 }
57}