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); } }
@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; }
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()); }
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()); }
/** * <pre> * The label key. * </pre> * * <code>string key = 1;</code> */ public Builder clearKey() { key_ = getDefaultInstance().getKey(); 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; }
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); } }
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); } }
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; }