| /******************************************************************************* |
| * Copyright (c) 2021 Contributors to the Eclipse Foundation |
| * |
| * See the NOTICE file(s) distributed with this work for additional |
| * information regarding copyright ownership. |
| * |
| * This program and the accompanying materials are made available under the |
| * terms of the Eclipse Public License v. 2.0 which is available at |
| * http://www.eclipse.org/legal/epl-2.0. |
| * |
| * SPDX-License-Identifier: EPL-2.0 |
| *******************************************************************************/ |
| package org.eclipse.mdm.webclient.entity; |
| |
| import static java.util.stream.Collectors.toList; |
| |
| import java.util.ArrayList; |
| import java.util.Collections; |
| import java.util.List; |
| |
| import org.eclipse.mdm.api.base.query.Condition; |
| |
| |
| public class ConditionResponse { |
| |
| /** transferable data content */ |
| private final List<ConditionDTO> data; |
| |
| /** |
| * Constructor |
| * |
| * @param searchDefinitions list of {@link Suggestion}s to transfer |
| */ |
| public ConditionResponse(final List<Condition> conditions) { |
| this.data = conditions.stream().map(ConditionDTO::new).collect(toList()); |
| } |
| |
| public ConditionResponse() { |
| this.data = new ArrayList<>(); |
| } |
| |
| public List<ConditionDTO> getData() { |
| return Collections.unmodifiableList(this.data); |
| } |
| } |