@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptorForType().hashCode(); if (getTokensCount() > 0) { hash = (37 * hash) + TOKENS_FIELD_NUMBER; hash = (53 * hash) + getTokensList().hashCode(); } if (getSecretsCount() > 0) { hash = (37 * hash) + SECRETS_FIELD_NUMBER; hash = (53 * hash) + getSecretsList().hashCode(); } hash = (29 * hash) + getUnknownFields().hashCode(); memoizedHashCode = hash; return hash; }
/** * Populates keys/values from proto buffer storage. * @param in - stream ready to read a serialized proto buffer message */ void readProto(DataInput in) throws IOException { CredentialsProto storage = CredentialsProto.parseDelimitedFrom((DataInputStream)in); for (CredentialsKVProto kv : storage.getTokensList()) { addToken(new Text(kv.getAliasBytes().toByteArray()), (Token<? extends TokenIdentifier>) new Token(kv.getToken())); } for (CredentialsKVProto kv : storage.getSecretsList()) { addSecretKey(new Text(kv.getAliasBytes().toByteArray()), kv.getSecret().toByteArray()); } }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto)) { return super.equals(obj); } org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto other = (org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto) obj; boolean result = true; result = result && getTokensList() .equals(other.getTokensList()); result = result && getSecretsList() .equals(other.getSecretsList()); result = result && getUnknownFields().equals(other.getUnknownFields()); return result; }