com.farao_community.farao.cse.adapter.app.GetUrlUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gridcapa-cse-adapter-app Show documentation
Show all versions of gridcapa-cse-adapter-app Show documentation
Application that turns a RabbitMQ request from a task to a CSE request
The newest version!
/*
* Copyright (c) 2024, RTE (http://www.rte-france.com)
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
package com.farao_community.farao.cse.adapter.app;
import java.util.Map;
import java.util.Optional;
/**
* @author Daniel THIRION {@literal }
*/
public final class GetUrlUtil {
private GetUrlUtil() {
// private constructor to hide implicit one
}
static String getUrlOrThrow(final Map processFileUrlByType,
final FileType type) {
return Optional.ofNullable(processFileUrlByType.get(type.getName())).orElseThrow(() -> new CseAdapterException(type.getName() + " type not found"));
}
static String getUrlOrEmpty(final Map processFileUrlByType,
final FileType type) {
return Optional.ofNullable(processFileUrlByType.get(type.getName())).orElse("");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy