/** * * * <pre> * Metadata associated with the entity. * Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if * available. The associated keys are "wikipedia_url" and "mid", respectively. * </pre> * * <code>map<string, string> metadata = 3;</code> */ public java.lang.String getMetadataOrThrow(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap(); if (!map.containsKey(key)) { throw new java.lang.IllegalArgumentException(); } return map.get(key); }
@SuppressWarnings({"rawtypes"}) protected com.google.protobuf.MapField internalGetMapField(int number) { switch (number) { case 3: return internalGetMetadata(); default: throw new RuntimeException("Invalid map field number: " + number); } }
/** * * * <pre> * Metadata associated with the entity. * Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if * available. The associated keys are "wikipedia_url" and "mid", respectively. * </pre> * * <code>map<string, string> metadata = 3;</code> */ public java.lang.String getMetadataOrDefault( java.lang.String key, java.lang.String defaultValue) { if (key == null) { throw new java.lang.NullPointerException(); } java.util.Map<java.lang.String, java.lang.String> map = internalGetMetadata().getMap(); return map.containsKey(key) ? map.get(key) : defaultValue; } /**
@java.lang.Override public com.google.cloud.language.v1beta2.Entity buildPartial() { com.google.cloud.language.v1beta2.Entity result = new com.google.cloud.language.v1beta2.Entity(this); int from_bitField0_ = bitField0_; int to_bitField0_ = 0; result.name_ = name_; result.type_ = type_; result.metadata_ = internalGetMetadata(); result.metadata_.makeImmutable(); result.salience_ = salience_; if (mentionsBuilder_ == null) { if (((bitField0_ & 0x00000010) == 0x00000010)) { mentions_ = java.util.Collections.unmodifiableList(mentions_); bitField0_ = (bitField0_ & ~0x00000010); } result.mentions_ = mentions_; } else { result.mentions_ = mentionsBuilder_.build(); } if (sentimentBuilder_ == null) { result.sentiment_ = sentiment_; } else { result.sentiment_ = sentimentBuilder_.build(); } result.bitField0_ = to_bitField0_; onBuilt(); return result; }
/** * * * <pre> * Metadata associated with the entity. * Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if * available. The associated keys are "wikipedia_url" and "mid", respectively. * </pre> * * <code>map<string, string> metadata = 3;</code> */ public boolean containsMetadata(java.lang.String key) { if (key == null) { throw new java.lang.NullPointerException(); } return internalGetMetadata().getMap().containsKey(key); } /** Use {@link #getMetadataMap()} instead. */
/** * * * <pre> * Metadata associated with the entity. * Currently, Wikipedia URLs and Knowledge Graph MIDs are provided, if * available. The associated keys are "wikipedia_url" and "mid", respectively. * </pre> * * <code>map<string, string> metadata = 3;</code> */ public java.util.Map<java.lang.String, java.lang.String> getMetadataMap() { return internalGetMetadata().getMap(); } /**
public int getMetadataCount() { return internalGetMetadata().getMap().size(); } /**