buildframework/helium/sf/java/environment/src/com/nokia/helium/environment/ant/types/ExecutableInfo.java
changeset 628 7c4a911dc066
equal deleted inserted replaced
588:c7c26511138f 628:7c4a911dc066
       
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description: 
       
    15  *
       
    16  */
       
    17 
       
    18 package com.nokia.helium.environment.ant.types;
       
    19 
       
    20 import org.apache.tools.ant.types.DataType;
       
    21 
       
    22 /**
       
    23  * Provides information about an executable.
       
    24  * 
       
    25  * @ant.task name="executableinfo" category="Environment"
       
    26  */
       
    27 public class ExecutableInfo extends DataType {
       
    28     private String name;
       
    29     private String dir;
       
    30     private String versionArgs;
       
    31     private String versionRegex;
       
    32     private String output;
       
    33 
       
    34     public String getName() {
       
    35         return name;
       
    36     }
       
    37 
       
    38     public void setName(String name) {
       
    39         this.name = name;
       
    40     }
       
    41 
       
    42     public String getDir() {
       
    43         return dir;
       
    44     }
       
    45 
       
    46     public void setDir(String dir) {
       
    47         this.dir = dir;
       
    48     }
       
    49 
       
    50     public String getVersionArgs() {
       
    51         return versionArgs;
       
    52     }
       
    53 
       
    54     public void setVersionArgs(String versionArgs) {
       
    55         this.versionArgs = versionArgs;
       
    56     }
       
    57 
       
    58     public String getVersionRegex() {
       
    59         return versionRegex;
       
    60     }
       
    61 
       
    62     public void setVersionRegex(String versionRegex) {
       
    63         this.versionRegex = versionRegex;
       
    64     }
       
    65 
       
    66     public String getOutput() {
       
    67         return output;
       
    68     }
       
    69 
       
    70     public void setOutput(String output) {
       
    71         this.output = output;
       
    72     }
       
    73 
       
    74     public boolean equals(Object obj) {
       
    75         if (obj == null || !(obj instanceof ExecutableInfo)) {
       
    76             return false;
       
    77         }
       
    78         ExecutableInfo def = (ExecutableInfo) obj;
       
    79         if (this.name.equals(def.getName())) {
       
    80             if ((this.dir == null && def.getDir() == null)
       
    81                     || (this.dir != null && def.getDir() != null && this.dir.toLowerCase().equals(def.getDir().toLowerCase()))) {
       
    82                 return true;
       
    83             }
       
    84         }
       
    85         return false;
       
    86     }
       
    87     
       
    88     public int hashCode() {
       
    89         return name.hashCode();
       
    90     }
       
    91 
       
    92     public String toString() {
       
    93         return name + " " + versionArgs;
       
    94     }
       
    95 }
       
    96 
       
    97