William Kurkian | 1bedb41 | 2018-07-19 12:55:41 -0400 | [diff] [blame] | 1 | /*
|
| 2 | * Copyright 2018- Cisco
|
| 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 | package mapper;
|
| 17 |
|
| 18 | import org.slf4j.Logger;
|
| 19 | import org.slf4j.LoggerFactory;
|
| 20 | import com.google.gson.Gson;
|
| 21 | import com.google.gson.GsonBuilder;
|
| 22 |
|
| 23 | public class VesVolthaMapper {
|
| 24 |
|
| 25 | private final Logger logger = LoggerFactory.getLogger("VesVolthaMapper");
|
| 26 |
|
| 27 | private Gson gson;
|
| 28 |
|
| 29 | public VesVolthaMapper() {
|
| 30 | gson = new GsonBuilder().create();
|
| 31 | }
|
| 32 |
|
| 33 | public VesVolthaMessage parseJson(String json) {
|
| 34 | return gson.fromJson(json, VesVolthaMessage.class);
|
| 35 | }
|
| 36 | }
|