
org.bonitasoft.engine.command.model.SCommandImpl Maven / Gradle / Ivy
/**
* Copyright (C) 2012 BonitaSoft S.A.
* BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble
* This library is free software; you can redistribute it and/or modify it under the terms
* of the GNU Lesser General Public License as published by the Free Software Foundation
* version 2.1 of the License.
* This library 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 Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser 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.bonitasoft.engine.command.model;
/**
* @author Matthieu Chaffotte
*/
public class SCommandImpl implements SCommand {
private static final long serialVersionUID = 4257969847115435401L;
private long tenantId;
private long id;
private String name;
private String description;
private String implementation;
private boolean system;
public SCommandImpl() {
super();
}
public SCommandImpl(final String name, final String description, final String implementation) {
super();
this.name = name;
this.description = description;
this.implementation = implementation;
}
public SCommandImpl(final SCommand command) {
super();
this.id = command.getId();
this.name = command.getName();
this.description = command.getDescription();
this.implementation = command.getImplementation();
this.system = command.getSystem();
}
public void setSystem(boolean system) {
this.system = system;
}
@Override
public String getDiscriminator() {
return SCommandImpl.class.getName();
}
public long getTenantId() {
return this.tenantId;
}
@Override
public long getId() {
return id;
}
@Override
public String getName() {
return name;
}
@Override
public String getDescription() {
return description;
}
@Override
public String getImplementation() {
return implementation;
}
public void setTenantId(final long tenantId) {
this.tenantId = tenantId;
}
public void setId(final long id) {
this.id = id;
}
public void setName(final String name) {
this.name = name;
}
public void setDescription(final String description) {
this.description = description;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((description == null) ? 0 : description.hashCode());
result = prime * result + (int) (id ^ (id >>> 32));
result = prime * result + ((implementation == null) ? 0 : implementation.hashCode());
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + (int) (tenantId ^ (tenantId >>> 32));
result = prime * result + (system ? 1231 : 1237);
return result;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final SCommandImpl other = (SCommandImpl) obj;
if (description == null) {
if (other.description != null) {
return false;
}
} else if (!description.equals(other.description)) {
return false;
}
if (id != other.id) {
return false;
}
if (implementation == null) {
if (other.implementation != null) {
return false;
}
} else if (!implementation.equals(other.implementation)) {
return false;
}
if (name == null) {
if (other.name != null) {
return false;
}
} else if (!name.equals(other.name)) {
return false;
}
if (tenantId != other.tenantId) {
return false;
}
if (system != other.system) {
return false;
}
return true;
}
@Override
public boolean getSystem() {
return system;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy