com.seajas.search.bridge.contender.metadata.URIWriteConverter.java Source code

Java tutorial

Introduction

Here is the source code for com.seajas.search.bridge.contender.metadata.URIWriteConverter.java

Source

/**
 * Copyright (C) 2013 Seajas, the Netherlands.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 3, as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.seajas.search.bridge.contender.metadata;

import java.net.URI;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.convert.WritingConverter;

/**
 * Convert the given URI to a Mongo object.
 *
 * @author Jasper van Veghel <jasper@seajas.com>
 */
@WritingConverter
public class URIWriteConverter implements Converter<URI, String> {
    /**
     * {@inheritDoc}
     */
    @Override
    public String convert(final URI source) {
        return source.toString();
    }
}