org.conqat.engine.service.shared.data.ProjectMapping 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 (c) CQSE GmbH
*
* 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 org.conqat.engine.index.shared.PublicProjectId;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.teamscale.commons.lang.ToStringHelpers;
/**
* Basic data container that contains a project and prefix mapping
*
* This class is used as DTO during communication with IDE clients via
* {@link com.teamscale.ide.commons.client.IIdeServiceClient}, special care has
* to be taken when changing its signature!
*/
public class ProjectMapping {
/** The full path of the file that was used for the mapping */
@JsonProperty("fullFilePath")
public final String fullFilePath;
/** The project id of the project that the mapping is valid for */
@JsonProperty("projectId")
public final String projectId;
/** The local path of the mapping. */
@JsonProperty("from")
public final String from;
/** The server path of the mapping. */
@JsonProperty("to")
public final String to;
/** Empty constructor for serialization */
public ProjectMapping() {
this("", ".", "", "");
}
/** Constructor. */
public ProjectMapping(String fullFilePath, PublicProjectId project, String from, String to) {
this(fullFilePath, project.toString(), from, to);
}
/** Constructor. */
public ProjectMapping(String fullFilePath, String project, String from, String to) {
this.fullFilePath = fullFilePath;
this.projectId = project;
this.from = from;
this.to = to;
}
/** {@inheritDoc} */
@Override
public String toString() {
return ToStringHelpers.toReflectiveStringHelper(this).toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy