add endpointcost-northbound-route
[alto.git] / alto-core / standard-northbound-routes / endpointcost / impl / src / main / java / org / opendaylight / alto / core / northbound / route / endpointcost / impl / EndpointcostRouteChecker.java
1 /*
2  * Copyright (c) 2015 Yale University 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
9 package org.opendaylight.alto.core.northbound.route.endpointcost.impl;
10
11 import javax.ws.rs.core.Response;
12
13 import com.fasterxml.jackson.databind.JsonNode;
14
15 public class EndpointcostRouteChecker {
16
17     public static Response checkMissing(JsonNode target, String field, String origin) {
18         if (target == null) {
19             // TODO :: report missing field, something like
20             // return new AltoMissingFieldError(field, origin);
21             return null;
22         }
23         return null;
24     }
25
26     public static Response checkList(JsonNode list, String field, String origin) {
27         if (!list.isArray()) {
28             // TODO :: report invalid field type, something like
29             // return new AltoInvalidFieldType(field, "array", origin);
30             return null;
31         }
32         return null;
33     }
34
35 }