public org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto buildPartial() { org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto result = new org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto(this); int from_bitField0_ = bitField0_; if (tokensBuilder_ == null) { if (((bitField0_ & 0x00000001) == 0x00000001)) { tokens_ = java.util.Collections.unmodifiableList(tokens_); bitField0_ = (bitField0_ & ~0x00000001); } result.tokens_ = tokens_; } else { result.tokens_ = tokensBuilder_.build(); } if (secretsBuilder_ == null) { if (((bitField0_ & 0x00000002) == 0x00000002)) { secrets_ = java.util.Collections.unmodifiableList(secrets_); bitField0_ = (bitField0_ & ~0x00000002); } result.secrets_ = secrets_; } else { result.secrets_ = secretsBuilder_.build(); } onBuilt(); return result; }
public Builder mergeFrom(org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto other) { if (other == org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto.getDefaultInstance()) return this; if (tokensBuilder_ == null) { if (!other.tokens_.isEmpty()) { this.mergeUnknownFields(other.getUnknownFields()); return this;
@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; }
public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized != -1) return isInitialized == 1; for (int i = 0; i < getTokensCount(); i++) { if (!getTokens(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } for (int i = 0; i < getSecretsCount(); i++) { if (!getSecrets(i).isInitialized()) { memoizedIsInitialized = 0; return false; } } memoizedIsInitialized = 1; return true; }
@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; }
public org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto getDefaultInstanceForType() { return org.apache.hadoop.security.proto.SecurityProtos.CredentialsProto.getDefaultInstance(); }
/** * 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()); } }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { getSerializedSize(); for (int i = 0; i < tokens_.size(); i++) { output.writeMessage(1, tokens_.get(i)); } for (int i = 0; i < secrets_.size(); i++) { output.writeMessage(2, secrets_.get(i)); } getUnknownFields().writeTo(output); }