| 1 | /** | 
| 2 |  * | 
| 3 |  * Copyright (C) 2011 Cloud Conscious, LLC. <info@cloudconscious.com> | 
| 4 |  * | 
| 5 |  * ==================================================================== | 
| 6 |  * Licensed under the Apache License, Version 2.0 (the "License"); | 
| 7 |  * you may not use this file except in compliance with the License. | 
| 8 |  * 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 |  */ | 
| 19 | package org.jclouds.compute.domain.os; | 
| 20 |   | 
| 21 | import org.jclouds.compute.domain.OsFamily; | 
| 22 |   | 
| 23 | /** | 
| 24 |  *  | 
| 25 |  * @author Adrian Cole | 
| 26 |  *  | 
| 27 |  */ | 
| 28 | public class OsFamilyVersion64Bit { | 
| 29 |    public OsFamily family; | 
| 30 |    public String version; | 
| 31 |    public boolean is64Bit; | 
| 32 |   | 
| 33 |    // for serialization | 
| 34 |    OsFamilyVersion64Bit() { | 
| 35 |   | 
| 36 |    } | 
| 37 |   | 
| 38 |    public OsFamilyVersion64Bit(OsFamily family, String version, boolean is64Bit) { | 
| 39 |       this.family = family; | 
| 40 |       this.version = version; | 
| 41 |       this.is64Bit = is64Bit; | 
| 42 |    } | 
| 43 |   | 
| 44 |    @Override | 
| 45 |    public String toString() { | 
| 46 |       return "OsFamilyVersion64Bit [family=" + family + ", version=" + version + ", is64Bit=" + is64Bit + "]"; | 
| 47 |    } | 
| 48 |   | 
| 49 |    @Override | 
| 50 |    public int hashCode() { | 
| 51 |       final int prime = 31; | 
| 52 |       int result = 1; | 
| 53 |       result = prime * result + ((family == null) ? 0 : family.hashCode()); | 
| 54 |       result = prime * result + (is64Bit ? 1231 : 1237); | 
| 55 |       result = prime * result + ((version == null) ? 0 : version.hashCode()); | 
| 56 |       return result; | 
| 57 |    } | 
| 58 |   | 
| 59 |    @Override | 
| 60 |    public boolean equals(Object obj) { | 
| 61 |       if (this == obj) | 
| 62 |          return true; | 
| 63 |       if (obj == null) | 
| 64 |          return false; | 
| 65 |       if (getClass() != obj.getClass()) | 
| 66 |          return false; | 
| 67 |       OsFamilyVersion64Bit other = (OsFamilyVersion64Bit) obj; | 
| 68 |       if (family != other.family) | 
| 69 |          return false; | 
| 70 |       if (is64Bit != other.is64Bit) | 
| 71 |          return false; | 
| 72 |       if (version == null) { | 
| 73 |          if (other.version != null) | 
| 74 |             return false; | 
| 75 |       } else if (!version.equals(other.version)) | 
| 76 |          return false; | 
| 77 |       return true; | 
| 78 |    } | 
| 79 | } |