|
| 1 | +/* |
| 2 | + * Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"). |
| 5 | + * You may not use this file except in compliance with the License. |
| 6 | + * A copy of the License is located at |
| 7 | + * |
| 8 | + * http://aws.amazon.com/apache2.0 |
| 9 | + * |
| 10 | + * or in the "license" file accompanying this file. This file is distributed |
| 11 | + * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either |
| 12 | + * express or implied. See the License for the specific language governing |
| 13 | + * permissions and limitations under the License. |
| 14 | + */ |
| 15 | + |
| 16 | +package com.amazonaws.services.chimesdkmessaging.model; |
| 17 | + |
| 18 | +import java.io.Serializable; |
| 19 | + |
| 20 | +/** |
| 21 | + * <p> |
| 22 | + * Summary of the membership details of an <code>AppInstanceUser</code>. |
| 23 | + * </p> |
| 24 | + */ |
| 25 | +public class AppInstanceUserMembershipSummary implements Serializable { |
| 26 | + /** |
| 27 | + * <p> |
| 28 | + * The type of <code>ChannelMembership</code>. |
| 29 | + * </p> |
| 30 | + * <p> |
| 31 | + * <b>Constraints:</b><br/> |
| 32 | + * <b>Allowed Values: </b>DEFAULT, HIDDEN |
| 33 | + */ |
| 34 | + private String type; |
| 35 | + |
| 36 | + /** |
| 37 | + * <p> |
| 38 | + * The time at which a message was last read. |
| 39 | + * </p> |
| 40 | + */ |
| 41 | + private java.util.Date readMarkerTimestamp; |
| 42 | + |
| 43 | + /** |
| 44 | + * <p> |
| 45 | + * The type of <code>ChannelMembership</code>. |
| 46 | + * </p> |
| 47 | + * <p> |
| 48 | + * <b>Constraints:</b><br/> |
| 49 | + * <b>Allowed Values: </b>DEFAULT, HIDDEN |
| 50 | + * |
| 51 | + * @return <p> |
| 52 | + * The type of <code>ChannelMembership</code>. |
| 53 | + * </p> |
| 54 | + * @see ChannelMembershipType |
| 55 | + */ |
| 56 | + public String getType() { |
| 57 | + return type; |
| 58 | + } |
| 59 | + |
| 60 | + /** |
| 61 | + * <p> |
| 62 | + * The type of <code>ChannelMembership</code>. |
| 63 | + * </p> |
| 64 | + * <p> |
| 65 | + * <b>Constraints:</b><br/> |
| 66 | + * <b>Allowed Values: </b>DEFAULT, HIDDEN |
| 67 | + * |
| 68 | + * @param type <p> |
| 69 | + * The type of <code>ChannelMembership</code>. |
| 70 | + * </p> |
| 71 | + * @see ChannelMembershipType |
| 72 | + */ |
| 73 | + public void setType(String type) { |
| 74 | + this.type = type; |
| 75 | + } |
| 76 | + |
| 77 | + /** |
| 78 | + * <p> |
| 79 | + * The type of <code>ChannelMembership</code>. |
| 80 | + * </p> |
| 81 | + * <p> |
| 82 | + * Returns a reference to this object so that method calls can be chained |
| 83 | + * together. |
| 84 | + * <p> |
| 85 | + * <b>Constraints:</b><br/> |
| 86 | + * <b>Allowed Values: </b>DEFAULT, HIDDEN |
| 87 | + * |
| 88 | + * @param type <p> |
| 89 | + * The type of <code>ChannelMembership</code>. |
| 90 | + * </p> |
| 91 | + * @return A reference to this updated object so that method calls can be |
| 92 | + * chained together. |
| 93 | + * @see ChannelMembershipType |
| 94 | + */ |
| 95 | + public AppInstanceUserMembershipSummary withType(String type) { |
| 96 | + this.type = type; |
| 97 | + return this; |
| 98 | + } |
| 99 | + |
| 100 | + /** |
| 101 | + * <p> |
| 102 | + * The type of <code>ChannelMembership</code>. |
| 103 | + * </p> |
| 104 | + * <p> |
| 105 | + * <b>Constraints:</b><br/> |
| 106 | + * <b>Allowed Values: </b>DEFAULT, HIDDEN |
| 107 | + * |
| 108 | + * @param type <p> |
| 109 | + * The type of <code>ChannelMembership</code>. |
| 110 | + * </p> |
| 111 | + * @see ChannelMembershipType |
| 112 | + */ |
| 113 | + public void setType(ChannelMembershipType type) { |
| 114 | + this.type = type.toString(); |
| 115 | + } |
| 116 | + |
| 117 | + /** |
| 118 | + * <p> |
| 119 | + * The type of <code>ChannelMembership</code>. |
| 120 | + * </p> |
| 121 | + * <p> |
| 122 | + * Returns a reference to this object so that method calls can be chained |
| 123 | + * together. |
| 124 | + * <p> |
| 125 | + * <b>Constraints:</b><br/> |
| 126 | + * <b>Allowed Values: </b>DEFAULT, HIDDEN |
| 127 | + * |
| 128 | + * @param type <p> |
| 129 | + * The type of <code>ChannelMembership</code>. |
| 130 | + * </p> |
| 131 | + * @return A reference to this updated object so that method calls can be |
| 132 | + * chained together. |
| 133 | + * @see ChannelMembershipType |
| 134 | + */ |
| 135 | + public AppInstanceUserMembershipSummary withType(ChannelMembershipType type) { |
| 136 | + this.type = type.toString(); |
| 137 | + return this; |
| 138 | + } |
| 139 | + |
| 140 | + /** |
| 141 | + * <p> |
| 142 | + * The time at which a message was last read. |
| 143 | + * </p> |
| 144 | + * |
| 145 | + * @return <p> |
| 146 | + * The time at which a message was last read. |
| 147 | + * </p> |
| 148 | + */ |
| 149 | + public java.util.Date getReadMarkerTimestamp() { |
| 150 | + return readMarkerTimestamp; |
| 151 | + } |
| 152 | + |
| 153 | + /** |
| 154 | + * <p> |
| 155 | + * The time at which a message was last read. |
| 156 | + * </p> |
| 157 | + * |
| 158 | + * @param readMarkerTimestamp <p> |
| 159 | + * The time at which a message was last read. |
| 160 | + * </p> |
| 161 | + */ |
| 162 | + public void setReadMarkerTimestamp(java.util.Date readMarkerTimestamp) { |
| 163 | + this.readMarkerTimestamp = readMarkerTimestamp; |
| 164 | + } |
| 165 | + |
| 166 | + /** |
| 167 | + * <p> |
| 168 | + * The time at which a message was last read. |
| 169 | + * </p> |
| 170 | + * <p> |
| 171 | + * Returns a reference to this object so that method calls can be chained |
| 172 | + * together. |
| 173 | + * |
| 174 | + * @param readMarkerTimestamp <p> |
| 175 | + * The time at which a message was last read. |
| 176 | + * </p> |
| 177 | + * @return A reference to this updated object so that method calls can be |
| 178 | + * chained together. |
| 179 | + */ |
| 180 | + public AppInstanceUserMembershipSummary withReadMarkerTimestamp( |
| 181 | + java.util.Date readMarkerTimestamp) { |
| 182 | + this.readMarkerTimestamp = readMarkerTimestamp; |
| 183 | + return this; |
| 184 | + } |
| 185 | + |
| 186 | + /** |
| 187 | + * Returns a string representation of this object; useful for testing and |
| 188 | + * debugging. |
| 189 | + * |
| 190 | + * @return A string representation of this object. |
| 191 | + * @see java.lang.Object#toString() |
| 192 | + */ |
| 193 | + @Override |
| 194 | + public String toString() { |
| 195 | + StringBuilder sb = new StringBuilder(); |
| 196 | + sb.append("{"); |
| 197 | + if (getType() != null) |
| 198 | + sb.append("Type: " + getType() + ","); |
| 199 | + if (getReadMarkerTimestamp() != null) |
| 200 | + sb.append("ReadMarkerTimestamp: " + getReadMarkerTimestamp()); |
| 201 | + sb.append("}"); |
| 202 | + return sb.toString(); |
| 203 | + } |
| 204 | + |
| 205 | + @Override |
| 206 | + public int hashCode() { |
| 207 | + final int prime = 31; |
| 208 | + int hashCode = 1; |
| 209 | + |
| 210 | + hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); |
| 211 | + hashCode = prime * hashCode |
| 212 | + + ((getReadMarkerTimestamp() == null) ? 0 : getReadMarkerTimestamp().hashCode()); |
| 213 | + return hashCode; |
| 214 | + } |
| 215 | + |
| 216 | + @Override |
| 217 | + public boolean equals(Object obj) { |
| 218 | + if (this == obj) |
| 219 | + return true; |
| 220 | + if (obj == null) |
| 221 | + return false; |
| 222 | + |
| 223 | + if (obj instanceof AppInstanceUserMembershipSummary == false) |
| 224 | + return false; |
| 225 | + AppInstanceUserMembershipSummary other = (AppInstanceUserMembershipSummary) obj; |
| 226 | + |
| 227 | + if (other.getType() == null ^ this.getType() == null) |
| 228 | + return false; |
| 229 | + if (other.getType() != null && other.getType().equals(this.getType()) == false) |
| 230 | + return false; |
| 231 | + if (other.getReadMarkerTimestamp() == null ^ this.getReadMarkerTimestamp() == null) |
| 232 | + return false; |
| 233 | + if (other.getReadMarkerTimestamp() != null |
| 234 | + && other.getReadMarkerTimestamp().equals(this.getReadMarkerTimestamp()) == false) |
| 235 | + return false; |
| 236 | + return true; |
| 237 | + } |
| 238 | +} |
0 commit comments