
fr.ird.observe.dto.report.ReportOperation Maven / Gradle / Ivy
package fr.ird.observe.dto.report;
/*-
* #%L
* ObServe Toolkit :: Dto
* %%
* Copyright (C) 2017 - 2021 Ultreia.io
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program. If not, see
* .
* #L%
*/
import fr.ird.observe.dto.ObserveDto;
import java.util.Objects;
/**
* Pour caractériser une opération à lancer dans un report.
*
* @author Tony Chemit - [email protected]
* @since 1.4
*/
public class ReportOperation implements ObserveDto {
private final String name;
private final String parameters;
public static ReportOperation of(String name) {
return of(name, "");
}
public static ReportOperation of(String name, String parameters) {
return new ReportOperation(name, parameters);
}
protected ReportOperation(String name, String parameters) {
this.name = Objects.requireNonNull(name);
this.parameters = Objects.requireNonNull(parameters);
}
public String getName() {
return name;
}
public String getParameters() {
return parameters;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ReportOperation)) return false;
ReportOperation that = (ReportOperation) o;
return name.equals(that.name) && parameters.equals(that.parameters);
}
@Override
public int hashCode() {
return Objects.hash(name, parameters);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy