001    /*
002     * Copyright (C) 2010 Evgeny Mandrikov
003     *
004     * Sonar-IDE is free software; you can redistribute it and/or
005     * modify it under the terms of the GNU Lesser General Public
006     * License as published by the Free Software Foundation; either
007     * version 3 of the License, or (at your option) any later version.
008     *
009     * Sonar-IDE is distributed in the hope that it will be useful,
010     * but WITHOUT ANY WARRANTY; without even the implied warranty of
011     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012     * Lesser General Public License for more details.
013     *
014     * You should have received a copy of the GNU Lesser General Public
015     * License along with Sonar-IDE; if not, write to the Free Software
016     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02
017     */
018    
019    package org.sonar.ide.shared.duplications;
020    
021    import org.apache.commons.lang.builder.ToStringBuilder;
022    import org.sonar.wsclient.services.Model;
023    
024    /**
025     * @author Evgeny Mandrikov
026     * @since 0.2
027     */
028    public final class Duplication {
029    
030      private int lines;
031      private int start;
032      private int targetStart;
033      private String targetResource;
034    
035      public Duplication(int lines, int start, int targetStart, String targetResource) {
036        this.lines = lines;
037        this.start = start;
038        this.targetStart = targetStart;
039        this.targetResource = targetResource;
040      }
041    
042      public int getLines() {
043        return lines;
044      }
045    
046      public void setLines(int lines) {
047        this.lines = lines;
048      }
049    
050      public int getStart() {
051        return start;
052      }
053    
054      public void setStart(int start) {
055        this.start = start;
056      }
057    
058      public int getTargetStart() {
059        return targetStart;
060      }
061    
062      public void setTargetStart(int targetStart) {
063        this.targetStart = targetStart;
064      }
065    
066      public String getTargetResource() {
067        return targetResource;
068      }
069    
070      public void setTargetResource(String targetResource) {
071        this.targetResource = targetResource;
072      }
073    
074      @Override
075      public String toString() {
076        return new ToStringBuilder(this).
077            append("lines", lines).
078            append("start", start).
079            append("targetStart", targetStart).
080            append("targetResource", targetResource).
081            toString();
082      }
083    }