/* * RHQ Management Platform * Copyright (C) 2005-2012 Red Hat, Inc. * All rights reserved. * * 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 version 2 of the License. * * 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, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ package org.rhq.modules.integrationTests.restApi.d; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; /** * An operation for testing * @author Heiko W. Rupp */ public class Operation { int id; String name; boolean readyToSubmit; int resourceId; int definitionId; Map<String,Object> params = new HashMap<String, Object>(); List<Link> links; public Operation() { } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public boolean isReadyToSubmit() { return readyToSubmit; } public void setReadyToSubmit(boolean readyToSubmit) { this.readyToSubmit = readyToSubmit; } public int getResourceId() { return resourceId; } public void setResourceId(int resourceId) { this.resourceId = resourceId; } public int getDefinitionId() { return definitionId; } public void setDefinitionId(int definitionId) { this.definitionId = definitionId; } public Map<String, Object> getParams() { return params; } public void setParams(Map<String, Object> params) { this.params = params; } public List<Link> getLinks() { return links; } public void setLinks(List<Link> links) { this.links = links; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Operation operation = (Operation) o; if (definitionId != operation.definitionId) return false; if (id != operation.id) return false; if (readyToSubmit != operation.readyToSubmit) return false; if (resourceId != operation.resourceId) return false; // if (links != null ? !links.equals(operation.links) : operation.links != null) return false; if (!name.equals(operation.name)) return false; if (params != null ? !params.equals(operation.params) : operation.params != null) return false; return true; } @Override public int hashCode() { int result = id; result = 31 * result + name.hashCode(); result = 31 * result + (readyToSubmit ? 1 : 0); result = 31 * result + resourceId; result = 31 * result + definitionId; result = 31 * result + (params != null ? params.hashCode() : 0); // result = 31 * result + (links != null ? links.hashCode() : 0); return result; } }