blob: 1ffa8ef0107cbf74f76bba0e34f3c2339fc6227c [file] [log] [blame]
Simon Hunt6c2555b2015-05-21 18:17:56 -07001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
17
18package org.onosproject.cord.gui.model;
19
20import com.fasterxml.jackson.databind.ObjectMapper;
21
22/**
23 * Default XOS function implementation, that does not have any parameters
24 * to tweak.
25 */
26public class DefaultXosFunction implements XosFunction {
27
28 protected static final ObjectMapper MAPPER = new ObjectMapper();
29
30 private final XosFunctionDescriptor xfd;
31
32 public DefaultXosFunction(XosFunctionDescriptor xfd) {
33 this.xfd = xfd;
34 }
35
36 public XosFunctionDescriptor descriptor() {
37 return xfd;
38 }
39
40 /**
41 * {@inheritDoc}
42 * <p>
43 * This default implementation throws an exception.
44 *
45 * @param user user to apply the change to
46 * @param param parameter name
47 * @param value new parameter value
48 * @throws UnsupportedOperationException if invoked
49 */
50 public void applyParam(SubscriberUser user, String param, String value) {
51 throw new UnsupportedOperationException();
52 }
53
54 public Memento createMemento() {
55 return null;
56 }
57
Simon Hunta00b0ce2015-05-22 15:57:11 -070058 public String xosUrlApply(SubscriberUser user) {
59 return null;
60 }
61
62 @Override
63 public String toString() {
64 return "{XosFunction: " + xfd + "}";
65 }
Simon Hunt6c2555b2015-05-21 18:17:56 -070066}