blob: 6eb9cf53397898b8b0ea2260eb562866137e54c8 [file] [log] [blame]
Kalhee Kimba366062017-11-07 16:32:09 +00001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
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 */
16
17package org.onosproject.dhcprelay.config;
18
19import org.onosproject.core.ApplicationId;
20import org.onosproject.net.config.Config;
21
22
23/**
24 * Dhcp Fpm Config.
25 */
26public class EnableDhcpFpmConfig extends Config<ApplicationId> {
27 public static final String KEY = "dhcpFpm";
28 private static final String DHCP_FPM_ENABLE = "enabled";
29
30 @Override
31 public boolean isValid() {
32 if (!hasFields(DHCP_FPM_ENABLE)) {
33 return false;
34 }
35 return isBoolean(DHCP_FPM_ENABLE, FieldPresence.OPTIONAL);
36 }
37
38 /**
39 * Returns whether Dhcp Fpm is enabled.
40 *
41 * @return true if enabled, otherwise false
42 */
43 public boolean getDhcpFpmEnable() {
44 return object.path(DHCP_FPM_ENABLE).asBoolean(false);
45 }
46}