Coverage Report - org.apache.giraph.scripting.DeployedScript
 
Classes in this File Line Coverage Branch Coverage Complexity
DeployedScript
0%
0/22
0%
0/10
1.857
 
 1  
 /*
 2  
  * Licensed to the Apache Software Foundation (ASF) under one
 3  
  * or more contributor license agreements.  See the NOTICE file
 4  
  * distributed with this work for additional information
 5  
  * regarding copyright ownership.  The ASF licenses this file
 6  
  * to you under the Apache License, Version 2.0 (the
 7  
  * "License"); you may not use this file except in compliance
 8  
  * with the License.  You may obtain a copy of the License at
 9  
  *
 10  
  *     http://www.apache.org/licenses/LICENSE-2.0
 11  
  *
 12  
  * Unless required by applicable law or agreed to in writing, software
 13  
  * distributed under the License is distributed on an "AS IS" BASIS,
 14  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15  
  * See the License for the specific language governing permissions and
 16  
  * limitations under the License.
 17  
  */
 18  
 package org.apache.giraph.scripting;
 19  
 
 20  
 import com.google.common.base.MoreObjects;
 21  
 import org.apache.giraph.graph.Language;
 22  
 import org.codehaus.jackson.annotate.JsonCreator;
 23  
 import org.codehaus.jackson.annotate.JsonProperty;
 24  
 
 25  
 import com.google.common.base.Objects;
 26  
 
 27  
 /**
 28  
  * A script that was deployed to the cluster.
 29  
  */
 30  
 public class DeployedScript {
 31  
   /** How the script was deployed */
 32  
   @JsonProperty
 33  
   private final DeployType deployType;
 34  
   /** Path to the script */
 35  
   @JsonProperty
 36  
   private final String path;
 37  
   /** Programming language the script is written in */
 38  
   @JsonProperty
 39  
   private final Language language;
 40  
 
 41  
   /**
 42  
    * Constructor
 43  
    *
 44  
    * @param path String path to resource
 45  
    * @param deployType deployment type
 46  
    * @param language programming language
 47  
    */
 48  
   @JsonCreator
 49  
   public DeployedScript(
 50  
       @JsonProperty("path") String path,
 51  
       @JsonProperty("deployType") DeployType deployType,
 52  0
       @JsonProperty("language") Language language) {
 53  0
     this.path = path;
 54  0
     this.deployType = deployType;
 55  0
     this.language = language;
 56  0
   }
 57  
 
 58  
   public DeployType getDeployType() {
 59  0
     return deployType;
 60  
   }
 61  
 
 62  
   public String getPath() {
 63  0
     return path;
 64  
   }
 65  
 
 66  
   public Language getLanguage() {
 67  0
     return language;
 68  
   }
 69  
 
 70  
   @Override
 71  
   public int hashCode() {
 72  0
     return Objects.hashCode(path, deployType, language);
 73  
   }
 74  
 
 75  
   @Override
 76  
   public boolean equals(Object obj) {
 77  0
     if (this == obj) {
 78  0
       return true;
 79  
     }
 80  0
     if (obj instanceof DeployedScript) {
 81  0
       DeployedScript other = (DeployedScript) obj;
 82  0
       return Objects.equal(path, other.path) &&
 83  0
           Objects.equal(deployType, other.deployType) &&
 84  0
           Objects.equal(language, other.language);
 85  
     }
 86  0
     return false;
 87  
   }
 88  
 
 89  
   @Override
 90  
   public String toString() {
 91  0
     return MoreObjects.toStringHelper(this)
 92  0
         .add("path", path)
 93  0
         .add("deployType", deployType)
 94  0
         .add("language", language)
 95  0
         .toString();
 96  
   }
 97  
 }