Java tutorial
/* * Dashboard * Copyright 2014 Christian Robert * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package de.perdian.apps.dashboard.mvc.modules.jenkins; import java.io.Serializable; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; class JenkinsControllerRequest implements Serializable { static final long serialVersionUID = 1L; private String jobName = null; private String url = null; private String username = null; private String password = null; @Override public int hashCode() { HashCodeBuilder hashCodeBuilder = new HashCodeBuilder(); hashCodeBuilder.append(this.getJobName()); hashCodeBuilder.append(this.getPassword()); hashCodeBuilder.append(this.getUrl()); hashCodeBuilder.append(this.getUsername()); return hashCodeBuilder.toHashCode(); } @Override public boolean equals(Object that) { if (that instanceof JenkinsControllerRequest) { JenkinsControllerRequest thatRequest = (JenkinsControllerRequest) that; EqualsBuilder equalsBuilder = new EqualsBuilder(); equalsBuilder.append(this.getJobName(), thatRequest.getJobName()); equalsBuilder.append(this.getPassword(), thatRequest.getPassword()); equalsBuilder.append(this.getUrl(), thatRequest.getUrl()); equalsBuilder.append(this.getUsername(), thatRequest.getUsername()); return equalsBuilder.isEquals(); } else { return false; } } // ------------------------------------------------------------------------- // --- Property access methods --------------------------------------------- // ------------------------------------------------------------------------- public String getJobName() { return this.jobName; } public void setJobName(String jobName) { this.jobName = jobName; } public String getUrl() { return this.url; } public void setUrl(String url) { this.url = url; } public String getUsername() { return this.username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return this.password; } public void setPassword(String password) { this.password = password; } }