001    /*
002     * Sonar, open source software quality management tool.
003     * Copyright (C) 2008-2012 SonarSource
004     * mailto:contact AT sonarsource DOT com
005     *
006     * Sonar is free software; you can redistribute it and/or
007     * modify it under the terms of the GNU Lesser General Public
008     * License as published by the Free Software Foundation; either
009     * version 3 of the License, or (at your option) any later version.
010     *
011     * Sonar is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014     * Lesser General Public License for more details.
015     *
016     * You should have received a copy of the GNU Lesser General Public
017     * License along with Sonar; if not, write to the Free Software
018     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
019     */
020    package org.sonar.core.duplication;
021    
022    /**
023     * A simple DTO (Data Transfer Object) class that provides the mapping of data to a table.
024     */
025    public final class DuplicationUnitDto {
026    
027      private Integer snapshotId;
028      private Integer projectSnapshotId;
029    
030      private String hash;
031      private int indexInFile;
032      private int startLine;
033      private int endLine;
034    
035      private String resourceKey;
036    
037      public DuplicationUnitDto() {
038      }
039    
040      public DuplicationUnitDto(Integer projectSnapshotId, Integer snapshotId, String hash, Integer indexInFile, Integer startLine, Integer endLine) {
041        this.projectSnapshotId = projectSnapshotId;
042        this.snapshotId = snapshotId;
043        this.hash = hash;
044        this.indexInFile = indexInFile;
045        this.startLine = startLine;
046        this.endLine = endLine;
047      }
048    
049      public Integer getSnapshotId() {
050        return snapshotId;
051      }
052    
053      public void setSnapshotId(Integer snapshotId) {
054        this.snapshotId = snapshotId;
055      }
056    
057      public Integer getProjectSnapshotId() {
058        return projectSnapshotId;
059      }
060    
061      public void setProjectSnapshotId(Integer projectSnapshotId) {
062        this.projectSnapshotId = projectSnapshotId;
063      }
064    
065      public String getHash() {
066        return hash;
067      }
068    
069      public void setHash(String hash) {
070        this.hash = hash;
071      }
072    
073      public int getIndexInFile() {
074        return indexInFile;
075      }
076    
077      public void setIndexInFile(int indexInFile) {
078        this.indexInFile = indexInFile;
079      }
080    
081      public int getStartLine() {
082        return startLine;
083      }
084    
085      public void setStartLine(int startLine) {
086        this.startLine = startLine;
087      }
088    
089      public int getEndLine() {
090        return endLine;
091      }
092    
093      public void setEndLine(int endLine) {
094        this.endLine = endLine;
095      }
096    
097      public String getResourceKey() {
098        return resourceKey;
099      }
100    
101      public void setResourceKey(String resourceKey) {
102        this.resourceKey = resourceKey;
103      }
104    
105    }