|
| 1 | +package com.robinpowered.sdk.model; |
| 2 | + |
| 3 | +import com.google.common.base.Objects; |
| 4 | +import org.joda.time.DateTime; |
| 5 | + |
| 6 | +/** |
| 7 | + * An amenity that may be associated with a {@link Space}. |
| 8 | + * |
| 9 | + * <p> |
| 10 | + * Amenities may be created or removed within an organization, though a default set of amenities is always present. |
| 11 | + * Each amenity may then be associated or disassociated from any spaces within that organization. |
| 12 | + */ |
| 13 | +public class Amenity implements ApiResponseModel { |
| 14 | + |
| 15 | + /** |
| 16 | + * Constants |
| 17 | + */ |
| 18 | + |
| 19 | + public static final String MIME_TYPE = "vnd.robinpowered.amenity.v1"; |
| 20 | + |
| 21 | + |
| 22 | + /** |
| 23 | + * Properties |
| 24 | + */ |
| 25 | + |
| 26 | + // Immutable |
| 27 | + private final int id; |
| 28 | + private final Integer accountId; |
| 29 | + private final DateTime createdAt; |
| 30 | + private final DateTime updatedAt; |
| 31 | + |
| 32 | + // Mutable |
| 33 | + private String name; |
| 34 | + |
| 35 | + |
| 36 | + /** |
| 37 | + * Methods |
| 38 | + */ |
| 39 | + |
| 40 | + public Amenity(int id, Integer accountId, DateTime createdAt, DateTime updatedAt) { |
| 41 | + this.id = id; |
| 42 | + this.accountId = accountId; |
| 43 | + this.createdAt = createdAt; |
| 44 | + this.updatedAt = updatedAt; |
| 45 | + } |
| 46 | + |
| 47 | + public int getId() { |
| 48 | + return id; |
| 49 | + } |
| 50 | + |
| 51 | + public Integer getAccountId() { |
| 52 | + return accountId; |
| 53 | + } |
| 54 | + |
| 55 | + public DateTime getCreatedAt() { |
| 56 | + return createdAt; |
| 57 | + } |
| 58 | + |
| 59 | + public DateTime getUpdatedAt() { |
| 60 | + return updatedAt; |
| 61 | + } |
| 62 | + |
| 63 | + public String getName() { |
| 64 | + return name; |
| 65 | + } |
| 66 | + |
| 67 | + public void setName(String name) { |
| 68 | + this.name = name; |
| 69 | + } |
| 70 | + |
| 71 | + @Override |
| 72 | + public boolean equals(Object o) { |
| 73 | + if (this == o) return true; |
| 74 | + if (o == null || getClass() != o.getClass()) return false; |
| 75 | + Amenity amenity = (Amenity) o; |
| 76 | + return Objects.equal(id, amenity.id) && |
| 77 | + Objects.equal(accountId, amenity.accountId) && |
| 78 | + Objects.equal(createdAt, amenity.createdAt) && |
| 79 | + Objects.equal(updatedAt, amenity.updatedAt); |
| 80 | + } |
| 81 | + |
| 82 | + @Override |
| 83 | + public int hashCode() { |
| 84 | + return Objects.hashCode(id, accountId, createdAt, updatedAt); |
| 85 | + } |
| 86 | + |
| 87 | + @Override |
| 88 | + public String toString() { |
| 89 | + return "Amenity{" + |
| 90 | + "id=" + id + |
| 91 | + ", accountId=" + accountId + |
| 92 | + ", createdAt=" + createdAt + |
| 93 | + ", updatedAt=" + updatedAt + |
| 94 | + ", name='" + name + '\'' + |
| 95 | + '}'; |
| 96 | + } |
| 97 | + |
| 98 | + @Override |
| 99 | + public String getMimeType() { |
| 100 | + return MIME_TYPE; |
| 101 | + } |
| 102 | +} |
0 commit comments