/* * SPDX-License-Identifier: Apache-2.0 * * The OpenSearch Contributors require contributions made to * this file be licensed under the Apache-2.0 license or a * compatible open source license. * * Modifications Copyright OpenSearch Contributors. See * GitHub history for details. */ package org.opensearch.timeseries.model; import java.util.List; import org.opensearch.ad.model.Mergeable; public class MergeableList implements Mergeable { private final List elements; public List getElements() { return elements; } public MergeableList(List elements) { this.elements = elements; } @Override public void merge(Mergeable other) { if (this == other || other == null || getClass() != other.getClass()) { return; } MergeableList otherList = (MergeableList) other; if (otherList.getElements() != null) { this.elements.addAll(otherList.getElements()); } } }