Merge "Fix thread safety issue with StartExi operation"
[controller.git] / opendaylight / config / config-persister-file-xml-adapter / src / main / java / org / opendaylight / controller / config / persist / storage / file / xml / model / StringTrimAdapter.java
1 /*
2  * Copyright (c) 2013 Cisco Systems, Inc. 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 package org.opendaylight.controller.config.persist.storage.file.xml.model;
9
10 import javax.xml.bind.annotation.adapters.XmlAdapter;
11
12 final class StringTrimAdapter extends XmlAdapter<String, String> {
13     @Override
14     public String unmarshal(String v) throws Exception {
15         if (v == null)
16             return null;
17         return v.trim();
18     }
19
20     @Override
21     public String marshal(String v) throws Exception {
22         if (v == null)
23             return null;
24         return v.trim();
25     }
26 }