org.conqat.engine.service.shared.data.ServiceApiInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of teamscale-commons Show documentation
Show all versions of teamscale-commons Show documentation
Provides common DTOs for Teamscale
/*-------------------------------------------------------------------------+
| |
| Copyright 2005-2011 the ConQAT Project |
| |
| 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 org.conqat.engine.service.shared.data;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Objects;
/**
* Transport object providing information about the server.
*/
public class ServiceApiInfo {
/** The current version of the service API */
@JsonProperty("apiVersion")
private final int apiVersion;
/** The minimum version of the service API still supported by the server */
@JsonProperty("minSupportedApiVersion")
private final int minSupportedApiVersion;
/**
* An URL (mailto or http) with contact information in case of problems (e.g.
* the server admin's email).
*/
@JsonProperty("adminContactUrl")
private final String adminContactUrl;
/** Constructor */
public ServiceApiInfo(int apiVersion, int minSupportedApiVersion, String adminContactUrl) {
this.apiVersion = apiVersion;
this.minSupportedApiVersion = minSupportedApiVersion;
this.adminContactUrl = adminContactUrl;
}
/** Returns apiVersion. */
public int getApiVersion() {
return apiVersion;
}
/** Returns minSupportedApiVersion. */
public int getMinSupportedApiVersion() {
return minSupportedApiVersion;
}
/** Returns adminContextUrl. */
public String getAdminContextUrl() {
return adminContactUrl;
}
/** {@inheritDoc} */
@Override
public int hashCode() {
return Objects.hashCode(adminContactUrl, apiVersion, minSupportedApiVersion);
}
/** {@inheritDoc} */
@Override
public boolean equals(Object obj) {
if (!(obj instanceof ServiceApiInfo)) {
return false;
}
ServiceApiInfo other = (ServiceApiInfo) obj;
if (!Objects.equal(adminContactUrl, other.adminContactUrl)) {
return false;
}
if (!Objects.equal(apiVersion, other.apiVersion)) {
return false;
}
if (!Objects.equal(minSupportedApiVersion, other.minSupportedApiVersion)) {
return false;
}
return true;
}
/** {@inheritDoc} */
@Override
public String toString() {
return "ServiceApiInfo [apiVersion=" + apiVersion + ", minSupportedApiVersion=" + minSupportedApiVersion
+ ", adminContactUrl=" + adminContactUrl + "]";
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy