001 /* 002 * Sonar, open source software quality management tool. 003 * Copyright (C) 2008-2011 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.persistence.model; 021 022 /** 023 * A simple DTO (Data Transfer Object) class that provides the mapping of data to a table. 024 */ 025 public class DuplicationUnit { 026 027 private Long id; 028 029 private Integer snapshotId; 030 private Integer projectSnapshotId; 031 032 private String hash; 033 private int indexInFile; 034 private int startLine; 035 private int endLine; 036 037 private String resourceKey; 038 039 public DuplicationUnit() { 040 } 041 042 public DuplicationUnit(Integer projectSnapshotId, Integer snapshotId, String hash, Integer indexInFile, Integer startLine, Integer endLine) { 043 this.projectSnapshotId = projectSnapshotId; 044 this.snapshotId = snapshotId; 045 this.hash = hash; 046 this.indexInFile = indexInFile; 047 this.startLine = startLine; 048 this.endLine = endLine; 049 } 050 051 public Long getId() { 052 return id; 053 } 054 055 public void setId(Long id) { 056 this.id = id; 057 } 058 059 public Integer getSnapshotId() { 060 return snapshotId; 061 } 062 063 public void setSnapshotId(Integer snapshotId) { 064 this.snapshotId = snapshotId; 065 } 066 067 public Integer getProjectSnapshotId() { 068 return projectSnapshotId; 069 } 070 071 public void setProjectSnapshotId(Integer projectSnapshotId) { 072 this.projectSnapshotId = projectSnapshotId; 073 } 074 075 public String getHash() { 076 return hash; 077 } 078 079 public void setHash(String hash) { 080 this.hash = hash; 081 } 082 083 public int getIndexInFile() { 084 return indexInFile; 085 } 086 087 public void setIndexInFile(int indexInFile) { 088 this.indexInFile = indexInFile; 089 } 090 091 public int getStartLine() { 092 return startLine; 093 } 094 095 public void setStartLine(int startLine) { 096 this.startLine = startLine; 097 } 098 099 public int getEndLine() { 100 return endLine; 101 } 102 103 public void setEndLine(int endLine) { 104 this.endLine = endLine; 105 } 106 107 public String getResourceKey() { 108 return resourceKey; 109 } 110 111 public void setResourceKey(String resourceKey) { 112 this.resourceKey = resourceKey; 113 } 114 115 }