@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); if (hasTxnId()) { hash = (37 * hash) + TXNID_FIELD_NUMBER; hash = (53 * hash) + getTxnId().hashCode(); } if (getActiveSegmentsCount() > 0) { hash = (37 * hash) + ACTIVESEGMENTS_FIELD_NUMBER; hash = (53 * hash) + getActiveSegmentsList().hashCode(); } hash = (37 * hash) + DELEGATIONTOKEN_FIELD_NUMBER; hash = (53 * hash) + getDelegationToken().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
if (!other.getDelegationToken().isEmpty()) { delegationToken_ = other.delegationToken_; onChanged();
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.pravega.controller.stream.api.grpc.v1.Controller.CreateTxnResponse)) { return super.equals(obj); } io.pravega.controller.stream.api.grpc.v1.Controller.CreateTxnResponse other = (io.pravega.controller.stream.api.grpc.v1.Controller.CreateTxnResponse) obj; boolean result = true; result = result && (hasTxnId() == other.hasTxnId()); if (hasTxnId()) { result = result && getTxnId() .equals(other.getTxnId()); } result = result && getActiveSegmentsList() .equals(other.getActiveSegmentsList()); result = result && getDelegationToken() .equals(other.getDelegationToken()); result = result && unknownFields.equals(other.unknownFields); return result; }
private TxnSegments convert(CreateTxnResponse response) { NavigableMap<Double, SegmentWithRange> rangeMap = new TreeMap<>(); for (SegmentRange r : response.getActiveSegmentsList()) { Preconditions.checkState(r.getMinKey() <= r.getMaxKey()); rangeMap.put(r.getMaxKey(), new SegmentWithRange(ModelHelper.encode(r.getSegmentId()), r.getMinKey(), r.getMaxKey())); } StreamSegments segments = new StreamSegments(rangeMap, response.getDelegationToken()); return new TxnSegments(segments, ModelHelper.encode(response.getTxnId())); }
/** * <code>string delegationToken = 3;</code> */ public Builder clearDelegationToken() { delegationToken_ = getDefaultInstance().getDelegationToken(); onChanged(); return this; } /**