de.otto.jsonhome.registry.controller.RegistryConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsonhome-registry Show documentation
Show all versions of jsonhome-registry Show documentation
Library used to write json-home registries for multiple json-home sources.
The newest version!
/*
* Copyright 2012 Guido Steinacker
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package de.otto.jsonhome.registry.controller;
import de.otto.jsonhome.registry.store.Link;
import de.otto.jsonhome.registry.store.Registry;
import java.net.URI;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import static de.otto.jsonhome.registry.controller.LinkConverter.jsonToLink;
import static de.otto.jsonhome.registry.controller.LinkConverter.linkToJson;
import static java.util.stream.Collectors.toList;
/**
* A converter used to convert Registry and Link items into maps and vice versa.
*
* @author Guido Steinacker
* @since 14.11.12
*/
public class RegistryConverter {
private RegistryConverter() {}
public static Registry jsonToRegistry(final Map map) {
try {
@SuppressWarnings("unchecked")
final List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy