static LabelDescriptor fromPb(com.google.api.LabelDescriptor descriptorPb) { String description = null; if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { description = descriptorPb.getDescription(); } return new LabelDescriptor( descriptorPb.getKey(), ValueType.fromPb(descriptorPb.getValueType()), description); } }
com.google.api.LabelDescriptor toPb() { com.google.api.LabelDescriptor.Builder builder = com.google.api.LabelDescriptor.newBuilder().setKey(key).setValueType(valueType.toPb()); if (description != null) { builder.setDescription(description); } return builder.build(); }
/** * * * <pre> * The set of labels that must be defined to identify a particular * channel of the corresponding type. Each label includes a * description for how that field should be populated. * </pre> * * <code>repeated .google.api.LabelDescriptor labels = 4;</code> */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder() { return getLabelsFieldBuilder() .addBuilder(com.google.api.LabelDescriptor.getDefaultInstance()); } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.api.LabelDescriptor)) { return super.equals(obj); } com.google.api.LabelDescriptor other = (com.google.api.LabelDescriptor) obj; boolean result = true; result = result && getKey() .equals(other.getKey()); result = result && valueType_ == other.valueType_; result = result && getDescription() .equals(other.getDescription()); return result; }
public Builder mergeFrom(com.google.api.LabelDescriptor other) { if (other == com.google.api.LabelDescriptor.getDefaultInstance()) return this; if (!other.getKey().isEmpty()) { key_ = other.key_; onChanged(); } if (other.valueType_ != 0) { setValueTypeValue(other.getValueTypeValue()); } if (!other.getDescription().isEmpty()) { description_ = other.description_; onChanged(); } 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) + KEY_FIELD_NUMBER; hash = (53 * hash) + getKey().hashCode(); hash = (37 * hash) + VALUE_TYPE_FIELD_NUMBER; hash = (53 * hash) + valueType_; hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getDescription().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
/** * <pre> * The label key. * </pre> * * <code>string key = 1;</code> */ public Builder clearKey() { key_ = getDefaultInstance().getKey(); onChanged(); return this; } /**
/** * <pre> * A human-readable description for the label. * </pre> * * <code>string description = 3;</code> */ public Builder clearDescription() { description_ = getDefaultInstance().getDescription(); onChanged(); return this; } /**
input.readMessage(com.google.api.LabelDescriptor.parser(), extensionRegistry)); break;
private void validateLabel(LocationContext location, String fieldRef, LabelDescriptor label) { // - Label key cannot be empty. // - Label key cannot be longer than predefined limit. validateNonNullStringLength(location, String.format("%s label key", fieldRef), label.getKey()); // - Label description cannot be longer than predefined limit. validateStringLength( location, String.format("%s label description", fieldRef), label.getDescription()); }
input.readMessage(com.google.api.LabelDescriptor.parser(), extensionRegistry)); break;
static LabelDescriptor fromPb(com.google.api.LabelDescriptor descriptorPb) { String description = null; if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { description = descriptorPb.getDescription(); } return new LabelDescriptor( descriptorPb.getKey(), ValueType.fromPb(descriptorPb.getValueType()), description); } }
private void validateLabel(LocationContext location, String fieldRef, LabelDescriptor label) { // - Label key cannot be empty. // - Label key cannot be longer than predefined limit. validateNonNullStringLength(location, String.format("%s label key", fieldRef), label.getKey()); // - Label description cannot be longer than predefined limit. validateStringLength( location, String.format("%s label description", fieldRef), label.getDescription()); }
public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() {
/** * * * <pre> * The set of labels that must be defined to identify a particular * channel of the corresponding type. Each label includes a * description for how that field should be populated. * </pre> * * <code>repeated .google.api.LabelDescriptor labels = 4;</code> */ public com.google.api.LabelDescriptor.Builder addLabelsBuilder(int index) { return getLabelsFieldBuilder() .addBuilder(index, com.google.api.LabelDescriptor.getDefaultInstance()); } /**
input.readMessage(com.google.api.LabelDescriptor.parser(), extensionRegistry)); break;
static LabelDescriptor fromPb(com.google.api.LabelDescriptor descriptorPb) { String description = null; if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { description = descriptorPb.getDescription(); } return new LabelDescriptor(descriptorPb.getKey(), ValueType.fromPb(descriptorPb.getValueType()), description); } }
@VisibleForTesting static LabelDescriptor createLabelDescriptor(LabelKey labelKey) { LabelDescriptor.Builder builder = LabelDescriptor.newBuilder(); builder.setKey(labelKey.getKey()); builder.setDescription(labelKey.getDescription()); // Now we only support String tags builder.setValueType(ValueType.STRING); return builder.build(); }
public com.google.api.LabelDescriptor getDefaultInstanceForType() { return com.google.api.LabelDescriptor.getDefaultInstance(); }
input.readMessage(com.google.api.LabelDescriptor.parser(), extensionRegistry)); break;