Coverage Report - org.apache.maven.scm.command.blame.BlameLine
 
Classes in this File Line Coverage Branch Coverage Complexity
BlameLine
0 %
0/24
0 %
0/4
1,3
 
 1  
 package org.apache.maven.scm.command.blame;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  * http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import java.io.Serializable;
 23  
 import java.util.Date;
 24  
 
 25  
 /**
 26  
  * @author Evgeny Mandrikov
 27  
  * @since 1.4
 28  
  */
 29  
 public class BlameLine
 30  
     implements Serializable
 31  
 {
 32  
 
 33  
     private static final long serialVersionUID = 2675122069344705612L;
 34  
 
 35  
     private Date date;
 36  
 
 37  
     private String revision;
 38  
 
 39  
     private String author;
 40  
 
 41  
     private String committer;
 42  
 
 43  
     /**
 44  
      * @param date of the commit
 45  
      * @param revision of the commit
 46  
      * @param author will also be used as committer identification
 47  
      */
 48  
     public BlameLine( Date date, String revision, String author )
 49  
     {
 50  0
         this( date, revision, author, author );
 51  0
     }
 52  
 
 53  
     /**
 54  
      *
 55  
      * @param date of the commit
 56  
      * @param revision of the commit
 57  
      * @param author the person who wrote the line
 58  
      * @param committer the person who committed the change
 59  
      */
 60  
     public BlameLine( Date date, String revision, String author, String committer )
 61  0
     {
 62  0
         setDate( date );
 63  0
         setRevision( revision );
 64  0
         setAuthor( author );
 65  0
         setCommitter( committer );
 66  0
     }
 67  
 
 68  
     public String getRevision()
 69  
     {
 70  0
         return revision;
 71  
     }
 72  
 
 73  
     public void setRevision( String revision )
 74  
     {
 75  0
         this.revision = revision;
 76  0
     }
 77  
 
 78  
     public String getAuthor()
 79  
     {
 80  0
         return author;
 81  
     }
 82  
 
 83  
     public void setAuthor( String author )
 84  
     {
 85  0
         this.author = author;
 86  0
     }
 87  
 
 88  
     public String getCommitter()
 89  
     {
 90  0
         return committer;
 91  
     }
 92  
 
 93  
     public void setCommitter( String committer )
 94  
     {
 95  0
         this.committer = committer;
 96  0
     }
 97  
 
 98  
     /**
 99  
      * @return the commit date
 100  
      */
 101  
     public Date getDate()
 102  
     {
 103  0
         if ( date != null )
 104  
         {
 105  0
             return (Date) date.clone();
 106  
         }
 107  0
         return null;
 108  
     }
 109  
 
 110  
     public void setDate( Date date )
 111  
     {
 112  0
         if ( date != null )
 113  
         {
 114  0
             this.date = new Date( date.getTime() );
 115  
         }
 116  
         else
 117  
         {
 118  0
             this.date = null;
 119  
         }
 120  0
     }
 121  
 }