Coverage Report - com.jcabi.github.RtGit
 
Classes in this File Line Coverage Branch Coverage Complexity
RtGit
50%
6/12
0%
0/10
1
RtGit$AjcClosure1
100%
1/1
N/A
1
RtGit$AjcClosure11
0%
0/1
N/A
1
RtGit$AjcClosure3
0%
0/1
N/A
1
RtGit$AjcClosure5
0%
0/1
N/A
1
RtGit$AjcClosure7
0%
0/1
N/A
1
RtGit$AjcClosure9
0%
0/1
N/A
1
 
 1  2
 /**
 2  
  * Copyright (c) 2013-2015, jcabi.com
 3  
  * All rights reserved.
 4  
  *
 5  
  * Redistribution and use in source and binary forms, with or without
 6  
  * modification, are permitted provided that the following conditions
 7  
  * are met: 1) Redistributions of source code must retain the above
 8  
  * copyright notice, this list of conditions and the following
 9  
  * disclaimer. 2) Redistributions in binary form must reproduce the above
 10  
  * copyright notice, this list of conditions and the following
 11  
  * disclaimer in the documentation and/or other materials provided
 12  
  * with the distribution. 3) Neither the name of the jcabi.com nor
 13  
  * the names of its contributors may be used to endorse or promote
 14  
  * products derived from this software without specific prior written
 15  
  * permission.
 16  
  *
 17  
  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 18  
  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT
 19  
  * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 20  
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
 21  
  * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
 22  
  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 23  
  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 24  
  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 25  
  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 26  
  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 27  
  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
 28  
  * OF THE POSSIBILITY OF SUCH DAMAGE.
 29  
  */
 30  
 package com.jcabi.github;
 31  
 
 32  
 import com.jcabi.aspects.Immutable;
 33  
 import com.jcabi.aspects.Loggable;
 34  
 import com.jcabi.http.Request;
 35  
 import java.io.IOException;
 36  
 import javax.validation.constraints.NotNull;
 37  
 import lombok.EqualsAndHashCode;
 38  
 
 39  
 /**
 40  
  * Github Git.
 41  
  *
 42  
  * @author Carlos Miranda (miranda.cma@gmail.com)
 43  
  * @version $Id$
 44  
  * @since 0.8
 45  
  */
 46  
 @Immutable
 47  
 @Loggable(Loggable.DEBUG)
 48  0
 @EqualsAndHashCode(of = { "owner" })
 49  
 final class RtGit implements Git {
 50  
 
 51  
     /**
 52  
      * Repository.
 53  
      */
 54  
     private final transient Repo owner;
 55  
 
 56  
     /**
 57  
      * RESTful entry.
 58  
      */
 59  
     private final transient Request entry;
 60  
 
 61  
     /**
 62  
      * Public ctor.
 63  
      * @param req Request
 64  
      * @param repo Repository
 65  
      */
 66  2
     public RtGit(final Request req, final Repo repo) {
 67  2
         this.entry = req;
 68  2
         this.owner = repo;
 69  2
     }
 70  
 
 71  
     @Override
 72  
     @NotNull(message = "repository can't be NULL")
 73  
     public Repo repo() {
 74  2
         return this.owner;
 75  
     }
 76  
 
 77  
     @Override
 78  
     @NotNull(message = "blobs can't be NULL")
 79  
     public Blobs blobs() throws IOException {
 80  0
         return new RtBlobs(this.entry, this.repo());
 81  
     }
 82  
 
 83  
     @Override
 84  
     @NotNull(message = "commits can't be NULL")
 85  
     public Commits commits() {
 86  0
         return new RtCommits(this.entry, this.owner);
 87  
     }
 88  
 
 89  
     @Override
 90  
     @NotNull(message = "references can't be NULL")
 91  
     public References references() {
 92  0
         return new RtReferences(this.entry, this.owner);
 93  
     }
 94  
 
 95  
     @Override
 96  
     @NotNull(message = "tags can't be NULL")
 97  
     public Tags tags() {
 98  0
         return new RtTags(this.entry, this.owner);
 99  
     }
 100  
 
 101  
     @Override
 102  
     @NotNull(message = "trees can't be NULL")
 103  
     public Trees trees() {
 104  0
         return new RtTrees(this.entry, this.repo());
 105  
     }
 106  
 }