/*
 * Copyright 2017, TeamDev Ltd. All rights reserved.
 *
 * Redistribution and use in source and/or binary forms, with or without
 * modification, must retain the above copyright notice and the following
 * disclaimer.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

package org.spine3.server.entity.storage;

import com.google.common.collect.ImmutableMultimap;
import com.google.common.collect.Multimap;
import org.spine3.client.AggregatingColumnFilter.AggregatingOperator;
import org.spine3.client.ColumnFilter;

import java.io.Serializable;

import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.collect.ImmutableMultimap.copyOf;

/**
 * @author Dmytro Dashenkov
 */
public final class AggregatingQueryParameter implements Serializable {

    private static final long serialVersionUID = -475685759190562528L;

    private final AggregatingOperator operator;

    private final ImmutableMultimap<Column, ColumnFilter> filters;

    AggregatingQueryParameter(AggregatingOperator operator, Multimap<Column, ColumnFilter> filters) {
        this.operator = checkNotNull(operator);
        this.filters = copyOf(filters);
    }

    public AggregatingOperator getOperator() {
        return operator;
    }

    @SuppressWarnings("ReturnOfCollectionOrArrayField") // Immutable structure
    public ImmutableMultimap<Column, ColumnFilter> getFilters() {
        return filters;
    }
}

@@ -1049,24 +1049,106 @@
 y.storage;%0A%0A
+import com.google.common.base.MoreObjects;%0Aimport com.google.common.base.Objects;%0A
 import com.g
@@ -2249,11 +2249,780 @@
 s;%0A    %7D
+%0A%0A    @Override%0A    public boolean equals(Object o) %7B%0A        if (this == o) %7B%0A            return true;%0A        %7D%0A        if (o == null %7C%7C getClass() != o.getClass()) %7B%0A            return false;%0A        %7D%0A        AggregatingQueryParameter parameter = (AggregatingQueryParameter) o;%0A        return getOperator() == parameter.getOperator() &&%0A                Objects.equal(getFilters(), parameter.getFilters());%0A    %7D%0A%0A    @Override%0A    public int hashCode() %7B%0A        return Objects.hashCode(getOperator(), getFilters());%0A    %7D%0A%0A    @Override%0A    public String toString() %7B%0A        return MoreObjects.toStringHelper(this)%0A                          .add(%22operator%22, operator)%0A                          .add(%22filters%22, filters)%0A                          .toString();%0A    %7D
 %0A%7D%0A

Add Object methods to AggregateQueryParameter.