001/*-------------------------------------------------------------------------+ 002| | 003| Copyright 2005-2011 the ConQAT Project | 004| | 005| Licensed under the Apache License, Version 2.0 (the "License"); | 006| you may not use this file except in compliance with the License. | 007| You may obtain a copy of the License at | 008| | 009| http://www.apache.org/licenses/LICENSE-2.0 | 010| | 011| Unless required by applicable law or agreed to in writing, software | 012| distributed under the License is distributed on an "AS IS" BASIS, | 013| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 014| See the License for the specific language governing permissions and | 015| limitations under the License. | 016+-------------------------------------------------------------------------*/ 017package org.conqat.engine.service.shared.data; 018 019import com.fasterxml.jackson.annotation.JsonProperty; 020import com.teamscale.commons.lang.ToStringHelpers; 021 022/** 023 * Basic data container that contains a project and prefix mapping 024 * 025 * <strong>This class is used for communication with IDE clients (via the 026 * IdeServiceClient), so special care has to be taken when changing its 027 * signature!</strong> 028 */ 029public class ProjectMapping { 030 031 /** The full path of the file that was used for the mapping */ 032 @JsonProperty("fullFilePath") 033 public final String fullFilePath; 034 035 /** The project id of the project that the mapping is valid for */ 036 @JsonProperty("projectId") 037 public final String projectId; 038 039 /** The local path of the mapping. */ 040 @JsonProperty("from") 041 public final String from; 042 043 /** The server path of the mapping. */ 044 @JsonProperty("to") 045 public final String to; 046 047 /** Empty constructor for serialization */ 048 public ProjectMapping() { 049 this("", "", "", ""); 050 } 051 052 /** Constructor. */ 053 public ProjectMapping(String fullFilePath, String project, String from, String to) { 054 this.fullFilePath = fullFilePath; 055 this.projectId = project; 056 this.from = from; 057 this.to = to; 058 } 059 060 /** {@inheritDoc} */ 061 @Override 062 public String toString() { 063 return ToStringHelpers.toReflectiveStringHelper(this).toString(); 064 } 065 066}