| 1 | /** |
| 2 | * Licensed to jclouds, Inc. (jclouds) under one or more |
| 3 | * contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. jclouds 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, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
| 19 | package org.jclouds.compute.domain; |
| 20 | |
| 21 | |
| 22 | /** |
| 23 | * |
| 24 | * @author Adrian Cole |
| 25 | * |
| 26 | */ |
| 27 | public class OsFamilyVersion64Bit { |
| 28 | public OsFamily family; |
| 29 | public String version; |
| 30 | public boolean is64Bit; |
| 31 | |
| 32 | // for serialization |
| 33 | OsFamilyVersion64Bit() { |
| 34 | |
| 35 | } |
| 36 | |
| 37 | public OsFamilyVersion64Bit(OsFamily family, String version, boolean is64Bit) { |
| 38 | this.family = family; |
| 39 | this.version = version; |
| 40 | this.is64Bit = is64Bit; |
| 41 | } |
| 42 | |
| 43 | @Override |
| 44 | public String toString() { |
| 45 | return "[family=" + family + ", version=" + version + ", is64Bit=" + is64Bit + "]"; |
| 46 | } |
| 47 | |
| 48 | @Override |
| 49 | public int hashCode() { |
| 50 | final int prime = 31; |
| 51 | int result = 1; |
| 52 | result = prime * result + ((family == null) ? 0 : family.hashCode()); |
| 53 | result = prime * result + (is64Bit ? 1231 : 1237); |
| 54 | result = prime * result + ((version == null) ? 0 : version.hashCode()); |
| 55 | return result; |
| 56 | } |
| 57 | |
| 58 | @Override |
| 59 | public boolean equals(Object obj) { |
| 60 | if (this == obj) |
| 61 | return true; |
| 62 | if (obj == null) |
| 63 | return false; |
| 64 | if (getClass() != obj.getClass()) |
| 65 | return false; |
| 66 | OsFamilyVersion64Bit other = (OsFamilyVersion64Bit) obj; |
| 67 | if (family != other.family) |
| 68 | return false; |
| 69 | if (is64Bit != other.is64Bit) |
| 70 | return false; |
| 71 | if (version == null) { |
| 72 | if (other.version != null) |
| 73 | return false; |
| 74 | } else if (!version.equals(other.version)) |
| 75 | return false; |
| 76 | return true; |
| 77 | } |
| 78 | } |