|
| 1 | +/** |
| 2 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | + * contributor license agreements. See the NOTICE file distributed with this |
| 4 | + * work for additional information regarding copyright ownership. The ASF |
| 5 | + * licenses this file to you under the Apache License, Version 2.0 (the |
| 6 | + * "License"); you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * <p> |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * <p> |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | + * License for the specific language governing permissions and limitations under |
| 15 | + * the License. |
| 16 | + */ |
| 17 | +package org.apache.hadoop.yarn.server.federation.store.records.impl.pb; |
| 18 | + |
| 19 | +import org.apache.hadoop.classification.InterfaceAudience.Private; |
| 20 | +import org.apache.hadoop.classification.InterfaceStability.Unstable; |
| 21 | +import org.apache.hadoop.thirdparty.protobuf.TextFormat; |
| 22 | +import org.apache.hadoop.yarn.federation.proto.YarnServerFederationProtos.DeletePoliciesConfigurationsResponseProto; |
| 23 | +import org.apache.hadoop.yarn.server.federation.store.records.DeletePoliciesConfigurationsResponse; |
| 24 | + |
| 25 | + |
| 26 | +@Private |
| 27 | +@Unstable |
| 28 | +public class DeletePoliciesConfigurationsResponsePBImpl |
| 29 | + extends DeletePoliciesConfigurationsResponse { |
| 30 | + |
| 31 | + private DeletePoliciesConfigurationsResponseProto proto = |
| 32 | + DeletePoliciesConfigurationsResponseProto.getDefaultInstance(); |
| 33 | + |
| 34 | + private DeletePoliciesConfigurationsResponseProto.Builder builder = null; |
| 35 | + |
| 36 | + private boolean viaProto = false; |
| 37 | + |
| 38 | + public DeletePoliciesConfigurationsResponsePBImpl() { |
| 39 | + builder = DeletePoliciesConfigurationsResponseProto.newBuilder(); |
| 40 | + } |
| 41 | + |
| 42 | + public DeletePoliciesConfigurationsResponsePBImpl( |
| 43 | + DeletePoliciesConfigurationsResponseProto proto) { |
| 44 | + this.proto = proto; |
| 45 | + viaProto = true; |
| 46 | + } |
| 47 | + |
| 48 | + public DeletePoliciesConfigurationsResponseProto getProto() { |
| 49 | + proto = viaProto ? proto : builder.build(); |
| 50 | + viaProto = true; |
| 51 | + return proto; |
| 52 | + } |
| 53 | + |
| 54 | + @Override |
| 55 | + public int hashCode() { |
| 56 | + return getProto().hashCode(); |
| 57 | + } |
| 58 | + |
| 59 | + @Override |
| 60 | + public boolean equals(Object other) { |
| 61 | + if (other == null) { |
| 62 | + return false; |
| 63 | + } |
| 64 | + if (other.getClass().isAssignableFrom(this.getClass())) { |
| 65 | + return this.getProto().equals(this.getClass().cast(other).getProto()); |
| 66 | + } |
| 67 | + return false; |
| 68 | + } |
| 69 | + |
| 70 | + @Override |
| 71 | + public String toString() { |
| 72 | + return TextFormat.shortDebugString(getProto()); |
| 73 | + } |
| 74 | +} |
0 commit comments