/** * <code>optional string default_string = 5;</code> */ public java.lang.String getDefaultString() { java.lang.Object ref = defaultString_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); if (bs.isValidUtf8()) { defaultString_ = s; } return s; } else { return (java.lang.String) ref; } } /**
/** * <code>optional string default_string = 5;</code> */ public com.google.protobuf.ByteString getDefaultStringBytes() { java.lang.Object ref = defaultString_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); defaultString_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } }
/** * @deprecated As of release 2.0.0, this will be removed in HBase 3.0.0. */ @Deprecated public ByteString toByteString() { return ByteString.copyFrom(this.bytes, this.offset, this.length); }
/** * Tests if this bytestring starts with the specified prefix. * Similar to {@link String#startsWith(String)} * * @param prefix the prefix. * @return <code>true</code> if the byte sequence represented by the * argument is a prefix of the byte sequence represented by * this string; <code>false</code> otherwise. */ public boolean startsWith(ByteString prefix) { return size() >= prefix.size() && substring(0, prefix.size()).equals(prefix); }
byte[] getBytesFromResponse(ByteString response) { ByteBuffer bb = response.asReadOnlyByteBuffer(); bb.rewind(); byte[] bytes; if (bb.hasArray()) { bytes = bb.array(); } else { bytes = response.toByteArray(); } return bytes; } }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { for (int i = 0; i < instances_.size(); i++) { output.writeMessage(1, instances_.get(i)); } for (int i = 0; i < failedLocations_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, failedLocations_.getRaw(i)); } if (!getNextPageTokenBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, nextPageToken_); } unknownFields.writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!name_.isEmpty()) { output.writeBytes(1, name_); } if (!password_.isEmpty()) { output.writeBytes(2, password_); } for (int i = 0; i < roles_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 3, roles_.getRaw(i)); } unknownFields.writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (permType_ != authpb.Auth.Permission.Type.READ.getNumber()) { output.writeEnum(1, permType_); } if (!key_.isEmpty()) { output.writeBytes(2, key_); } if (!rangeEnd_.isEmpty()) { output.writeBytes(3, rangeEnd_); } unknownFields.writeTo(output); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getDestinationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); } if (!getClientIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); } if (batchId_ != 0L) { output.writeInt64(3, batchId_); } unknownFields.writeTo(output); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getSubscriptionBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, subscription_); } if (ackDeadlineSeconds_ != 0) { output.writeInt32(3, ackDeadlineSeconds_); } for (int i = 0; i < ackIds_.size(); i++) { com.google.protobuf.GeneratedMessageV3.writeString(output, 4, ackIds_.getRaw(i)); } unknownFields.writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!name_.isEmpty()) { output.writeBytes(1, name_); } for (int i = 0; i < keyPermission_.size(); i++) { output.writeMessage(2, keyPermission_.get(i)); } unknownFields.writeTo(output); }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getClassNameBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, className_); } for (int i = 0; i < member_.size(); i++) { output.writeMessage(2, member_.get(i)); } unknownFields.writeTo(output); }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (errorCodePresentCase_ == 1) { output.writeInt32( 1, (int)((java.lang.Integer) errorCodePresent_)); } if (!getErrorMessageBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, errorMessage_); } unknownFields.writeTo(output); }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + PERMTYPE_FIELD_NUMBER; hash = (53 * hash) + permType_; hash = (37 * hash) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); hash = (37 * hash) + RANGE_END_FIELD_NUMBER; hash = (53 * hash) + getRangeEnd().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
@java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (errorCodePresentCase_ == 1) { size += com.google.protobuf.CodedOutputStream .computeInt32Size( 1, (int)((java.lang.Integer) errorCodePresent_)); } if (!getErrorMessageBytes().isEmpty()) { size += com.google.protobuf.GeneratedMessageV3.computeStringSize(2, errorMessage_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; }
@java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (!getDestinationBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 1, destination_); } if (!getClientIdBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, clientId_); } if (!getFilterBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 7, filter_); } unknownFields.writeTo(output); }
/** * <code>string filter = 7;</code> */ public java.lang.String getFilter() { java.lang.Object ref = filter_; if (!(ref instanceof java.lang.String)) { com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref; java.lang.String s = bs.toStringUtf8(); filter_ = s; return s; } else { return (java.lang.String) ref; } } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof authpb.Auth.Permission)) { return super.equals(obj); } authpb.Auth.Permission other = (authpb.Auth.Permission) obj; boolean result = true; result = result && permType_ == other.permType_; result = result && getKey() .equals(other.getKey()); result = result && getRangeEnd() .equals(other.getRangeEnd()); result = result && unknownFields.equals(other.unknownFields); return result; }
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (location_ != null) { output.writeMessage(1, getLocation()); } if (!getMessageBytes().isEmpty()) { com.google.protobuf.GeneratedMessageV3.writeString(output, 2, message_); } }
public byte[] getPayload() { return msgBuilder.getPayload().toByteArray(); // TODO PERFORMANCE array copy }