@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.vitess.proto.Vtrpc.CallerID)) { return super.equals(obj); } io.vitess.proto.Vtrpc.CallerID other = (io.vitess.proto.Vtrpc.CallerID) obj; boolean result = true; result = result && getPrincipal() .equals(other.getPrincipal()); result = result && getComponent() .equals(other.getComponent()); result = result && getSubcomponent() .equals(other.getSubcomponent()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getPrincipalBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, principal_); } if (!getComponentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, component_); } if (!getSubcomponentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subcomponent_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
public Builder mergeFrom(io.vitess.proto.Vtrpc.CallerID other) { if (other == io.vitess.proto.Vtrpc.CallerID.getDefaultInstance()) return this; if (!other.getPrincipal().isEmpty()) { principal_ = other.principal_; onChanged(); } if (!other.getComponent().isEmpty()) { component_ = other.component_; onChanged(); } if (!other.getSubcomponent().isEmpty()) { subcomponent_ = other.subcomponent_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
/** * Create context used to create grpc client and executing query. * * @param username * @param timeout * @return */ public static Context createContext(String username, long timeout) { Context context = Context.getDefault(); Vtrpc.CallerID callerID = null; if (null != username) { callerID = Vtrpc.CallerID.newBuilder().setPrincipal(username).build(); } if (null != callerID) { context = context.withCallerId(callerID); } if (timeout > 0) { context = context.withDeadlineAfter(Duration.millis(timeout)); } return context; } }
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof io.vitess.proto.Vtrpc.CallerID)) { return super.equals(obj); } io.vitess.proto.Vtrpc.CallerID other = (io.vitess.proto.Vtrpc.CallerID) obj; boolean result = true; result = result && getPrincipal() .equals(other.getPrincipal()); result = result && getComponent() .equals(other.getComponent()); result = result && getSubcomponent() .equals(other.getSubcomponent()); result = result && unknownFields.equals(other.unknownFields); return result; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (!getPrincipalBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, principal_); } if (!getComponentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, component_); } if (!getSubcomponentBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(3, subcomponent_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
/** * <pre> * principal is the effective user identifier. It is usually filled in * with whoever made the request to the appserver, if the request * came from an automated job or another system component. * If the request comes directly from the Internet, or if the Vitess client * takes action on its own accord, it is okay for this field to be absent. * </pre> * * <code>string principal = 1;</code> */ public Builder clearPrincipal() { principal_ = getDefaultInstance().getPrincipal(); onChanged(); return this; } /**
/** * <pre> * principal is the effective user identifier. It is usually filled in * with whoever made the request to the appserver, if the request * came from an automated job or another system component. * If the request comes directly from the Internet, or if the Vitess client * takes action on its own accord, it is okay for this field to be absent. * </pre> * * <code>string principal = 1;</code> */ public Builder clearPrincipal() { principal_ = getDefaultInstance().getPrincipal(); onChanged(); return this; } /**
/** * <pre> * component describes the running process of the effective caller. * It can for instance be the hostname:port of the servlet initiating the * database call, or the container engine ID used by the servlet. * </pre> * * <code>string component = 2;</code> */ public Builder clearComponent() { component_ = getDefaultInstance().getComponent(); onChanged(); return this; } /**
/** * <pre> * component describes the running process of the effective caller. * It can for instance be the hostname:port of the servlet initiating the * database call, or the container engine ID used by the servlet. * </pre> * * <code>string component = 2;</code> */ public Builder clearComponent() { component_ = getDefaultInstance().getComponent(); onChanged(); return this; } /**
/** * <pre> * subcomponent describes a component inisde the immediate caller which * is responsible for generating is request. Suggested values are a * servlet name or an API endpoint name. * </pre> * * <code>string subcomponent = 3;</code> */ public Builder clearSubcomponent() { subcomponent_ = getDefaultInstance().getSubcomponent(); onChanged(); return this; } /**
public Builder mergeFrom(io.vitess.proto.Vtrpc.CallerID other) { if (other == io.vitess.proto.Vtrpc.CallerID.getDefaultInstance()) return this; if (!other.getPrincipal().isEmpty()) { principal_ = other.principal_; onChanged(); } if (!other.getComponent().isEmpty()) { component_ = other.component_; onChanged(); } if (!other.getSubcomponent().isEmpty()) { subcomponent_ = other.subcomponent_; onChanged(); } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PRINCIPAL_FIELD_NUMBER; hash = (53 * hash) + getPrincipal().hashCode(); hash = (37 * hash) + COMPONENT_FIELD_NUMBER; hash = (53 * hash) + getComponent().hashCode(); hash = (37 * hash) + SUBCOMPONENT_FIELD_NUMBER; hash = (53 * hash) + getSubcomponent().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PRINCIPAL_FIELD_NUMBER; hash = (53 * hash) + getPrincipal().hashCode(); hash = (37 * hash) + COMPONENT_FIELD_NUMBER; hash = (53 * hash) + getComponent().hashCode(); hash = (37 * hash) + SUBCOMPONENT_FIELD_NUMBER; hash = (53 * hash) + getSubcomponent().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * subcomponent describes a component inisde the immediate caller which * is responsible for generating is request. Suggested values are a * servlet name or an API endpoint name. * </pre> * * <code>string subcomponent = 3;</code> */ public Builder clearSubcomponent() { subcomponent_ = getDefaultInstance().getSubcomponent(); onChanged(); return this; } /**
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getPrincipalBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principal_); } if (!getComponentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, component_); } if (!getSubcomponentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subcomponent_); } unknownFields.writeTo(output); }
@java.lang.Override public io.vitess.proto.Vtrpc.CallerID getDefaultInstanceForType() { return io.vitess.proto.Vtrpc.CallerID.getDefaultInstance(); }
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
@java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getPrincipalBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, principal_); } if (!getComponentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, component_); } if (!getSubcomponentBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, subcomponent_); } unknownFields.writeTo(output); }