public static MonitoredResourceDescriptor fromPb( com.google.api.MonitoredResourceDescriptor descriptorPb) { Builder builder = newBuilder(descriptorPb.getType()); if (descriptorPb.getName() != null && !descriptorPb.getName().equals("")) { builder.setName(descriptorPb.getName()); } if (descriptorPb.getDisplayName() != null && !descriptorPb.getDisplayName().equals("")) { builder.setDisplayName(descriptorPb.getDisplayName()); } if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { builder.setDescription(descriptorPb.getDescription()); } builder.setLabels( Lists.transform(descriptorPb.getLabelsList(), LabelDescriptor.FROM_PB_FUNCTION)); return builder.build(); } }
/** * <pre> * Optional. The resource name of the monitored resource descriptor: * `"projects/{project_id}/monitoredResourceDescriptors/{type}"` where * {type} is the value of the `type` field in this object and * {project_id} is a project ID that provides API-specific context for * accessing the type. APIs that do not use project information can use the * resource name format `"monitoredResourceDescriptors/{type}"`. * </pre> * * <code>string name = 5;</code> */ public Builder clearName() { name_ = getDefaultInstance().getName(); onChanged(); return this; } /**
@java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.api.MonitoredResourceDescriptor)) { return super.equals(obj); } com.google.api.MonitoredResourceDescriptor other = (com.google.api.MonitoredResourceDescriptor) obj; boolean result = true; result = result && getName() .equals(other.getName()); result = result && getType() .equals(other.getType()); result = result && getDisplayName() .equals(other.getDisplayName()); result = result && getDescription() .equals(other.getDescription()); result = result && getLabelsList() .equals(other.getLabelsList()); return result; }
@java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + NAME_FIELD_NUMBER; hash = (53 * hash) + getName().hashCode(); hash = (37 * hash) + TYPE_FIELD_NUMBER; hash = (53 * hash) + getType().hashCode(); hash = (37 * hash) + DISPLAY_NAME_FIELD_NUMBER; hash = (53 * hash) + getDisplayName().hashCode(); hash = (37 * hash) + DESCRIPTION_FIELD_NUMBER; hash = (53 * hash) + getDescription().hashCode(); if (getLabelsCount() > 0) { hash = (37 * hash) + LABELS_FIELD_NUMBER; hash = (53 * hash) + getLabelsList().hashCode(); } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; }
public static MonitoredResourceDescriptor fromPb( com.google.api.MonitoredResourceDescriptor descriptorPb) { Builder builder = builder(descriptorPb.getType()); if (descriptorPb.getName() != null && !descriptorPb.getName().equals("")) { builder.name(descriptorPb.getName()); } if (descriptorPb.getDisplayName() != null && !descriptorPb.getDisplayName().equals("")) { builder.displayName(descriptorPb.getDisplayName()); } if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { builder.description(descriptorPb.getDescription()); } builder.labels(Lists.transform(descriptorPb.getLabelsList(), LabelDescriptor.FROM_PB_FUNCTION)); return builder.build(); } }
public static MonitoredResourceDescriptor fromPb( com.google.api.MonitoredResourceDescriptor descriptorPb) { Builder builder = newBuilder(descriptorPb.getType()); if (descriptorPb.getName() != null && !descriptorPb.getName().equals("")) { builder.setName(descriptorPb.getName()); } if (descriptorPb.getDisplayName() != null && !descriptorPb.getDisplayName().equals("")) { builder.setDisplayName(descriptorPb.getDisplayName()); } if (descriptorPb.getDescription() != null && !descriptorPb.getDescription().equals("")) { builder.setDescription(descriptorPb.getDescription()); } builder.setLabels( Lists.transform(descriptorPb.getLabelsList(), LabelDescriptor.FROM_PB_FUNCTION)); return builder.build(); } }
public Builder mergeFrom(com.google.api.MonitoredResourceDescriptor other) { if (other == com.google.api.MonitoredResourceDescriptor.getDefaultInstance()) return this; if (!other.getName().isEmpty()) { name_ = other.name_; onChanged();