| 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.elasticstack.domain; |
| 20 | |
| 21 | import org.jclouds.compute.domain.OsFamily; |
| 22 | |
| 23 | import com.google.common.base.Objects; |
| 24 | |
| 25 | /** |
| 26 | * |
| 27 | * @author Adrian Cole |
| 28 | */ |
| 29 | public class WellKnownImage { |
| 30 | private String loginUser = "toor"; |
| 31 | private String uuid; |
| 32 | private String description; |
| 33 | private OsFamily osFamily; |
| 34 | private String osVersion; |
| 35 | private int size; |
| 36 | private boolean is64bit = true; |
| 37 | |
| 38 | // intended only for serialization |
| 39 | WellKnownImage() { |
| 40 | |
| 41 | } |
| 42 | |
| 43 | // performance isn't a concern on a infrequent object like this, so using shortcuts; |
| 44 | |
| 45 | public String getUuid() { |
| 46 | return uuid; |
| 47 | } |
| 48 | |
| 49 | public String getDescription() { |
| 50 | return description; |
| 51 | } |
| 52 | |
| 53 | public OsFamily getOsFamily() { |
| 54 | return osFamily; |
| 55 | } |
| 56 | |
| 57 | public String getOsVersion() { |
| 58 | return osVersion; |
| 59 | } |
| 60 | |
| 61 | public int getSize() { |
| 62 | return size; |
| 63 | } |
| 64 | |
| 65 | public boolean is64bit() { |
| 66 | return is64bit; |
| 67 | } |
| 68 | |
| 69 | public String getLoginUser() { |
| 70 | return loginUser; |
| 71 | } |
| 72 | |
| 73 | @Override |
| 74 | public int hashCode() { |
| 75 | return Objects.hashCode(uuid, description, osFamily, osVersion, size, is64bit, loginUser); |
| 76 | } |
| 77 | |
| 78 | @Override |
| 79 | public boolean equals(Object that) { |
| 80 | if (that == null) |
| 81 | return false; |
| 82 | return Objects.equal(this.toString(), that.toString()); |
| 83 | } |
| 84 | |
| 85 | @Override |
| 86 | public String toString() { |
| 87 | return Objects.toStringHelper(this).add("uuid", uuid).add("description", description).add("osFamily", osFamily) |
| 88 | .add("osVersion", osVersion).add("size", size).add("is64bit", is64bit).add("loginUser", loginUser) |
| 89 | .toString(); |
| 90 | } |
| 91 | |
| 92 | } |