com.marvelution.jira.plugins.sonar.rest.model.SonarAssociationConfigurationResource Maven / Gradle / Ivy
/*
* Licensed to Marvelution under one or more contributor license
* agreements. See the NOTICE file distributed with this work
* for additional information regarding copyright ownership.
* Marvelution licenses this file to you 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 com.marvelution.jira.plugins.sonar.rest.model;
import java.util.ArrayList;
import java.util.Collection;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
/**
* Soanr Association current configuration REST resource
*
* @author Mark Rekveld
*
* @since 1.2.0
*/
@XmlAccessorType(XmlAccessType.PROPERTY)
@XmlRootElement(name = "associationConfiguration")
public class SonarAssociationConfigurationResource {
private static final ToStringStyle TO_STRING_STYLE = ToStringStyle.SIMPLE_STYLE;
private Long associationId;
private Long projectId;
private Long componentId;
private String sonarServer;
private String sonarProject;
private Collection availableResources;
/**
* Default Constructor
*/
public SonarAssociationConfigurationResource() {
// Default constructor required by the REST framework
}
/**
* Constructor
*
* @param associationId the Association Id
* @param projectId the Project Id
* @param componentId the Component Id
* @param sonarServer the Sonar Server URL
* @param sonarProject the Sonar Project resource
*/
public SonarAssociationConfigurationResource(Long associationId, Long projectId, Long componentId,
String sonarServer, String sonarProject) {
this.associationId = associationId;
this.projectId = projectId;
this.componentId = componentId;
this.sonarServer = sonarServer;
this.sonarProject = sonarProject;
}
/**
* Getter for associationId
*
* @return the associationId
*/
public Long getAssociationId() {
return associationId;
}
/**
* Setter for associationId
*
* @param associationId the associationId to set
*/
public void setAssociationId(Long associationId) {
this.associationId = associationId;
}
/**
* Getter for projectId
*
* @return the projectId
*/
public Long getProjectId() {
return projectId;
}
/**
* Setter for projectId
*
* @param projectId the projectId to set
*/
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
/**
* Getter for componentId
*
* @return the componentId
*/
public Long getComponentId() {
return componentId;
}
/**
* Setter for componentId
*
* @param componentId the componentId to set
*/
public void setComponentId(Long componentId) {
this.componentId = componentId;
}
/**
* Getter for sonarServer
*
* @return the sonarServer
*/
public String getSonarServer() {
return sonarServer;
}
/**
* Setter for sonarServer
*
* @param sonarServer the sonarServer to set
*/
public void setSonarServer(String sonarServer) {
this.sonarServer = sonarServer;
}
/**
* Getter for sonarProject
*
* @return the sonarProject
*/
public String getSonarProject() {
return sonarProject;
}
/**
* Setter for sonarProject
*
* @param sonarProject the sonarProject to set
*/
public void setSonarProject(String sonarProject) {
this.sonarProject = sonarProject;
}
/**
* Getter for availableResources
*
* @return the availableResources
*/
public Collection getAvailableResources() {
if (availableResources == null) {
availableResources = new ArrayList();
}
return availableResources;
}
/**
* Setter for availableResources
*
* @param availableResources the availableResources to set
*/
public void setAvailableResources(Collection availableResources) {
this.availableResources = availableResources;
}
/**
* {@inheritDoc}
*/
@Override
public int hashCode() {
return HashCodeBuilder.reflectionHashCode(this);
}
/**
* {@inheritDoc}
*/
@Override
public boolean equals(Object object) {
return EqualsBuilder.reflectionEquals(this, object);
}
/**
* {@inheritDoc}
*/
@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, SonarAssociationConfigurationResource.TO_STRING_STYLE);
}
}