001// Generated by the protocol buffer compiler.  DO NOT EDIT!
002// NO CHECKED-IN PROTOBUF GENCODE
003// source: java/dev/enola/thing/thing.proto
004// Protobuf Java Version: 4.32.0
005
006package dev.enola.thing.proto;
007
008/**
009 * <pre>
010 * Thing is a generic datastructure for Linked Data.
011 *
012 * It is inspired by the Resource Description Framework (RDF)
013 * and its Subject / Predicate / Object "Triples". It's however
014 * not "flat", but represents "Blank Nodes" as "Unlabeled Nested"
015 * sub-structures, which makes it resemble regular ProtoBuf / JSON / YAML.
016 *
017 * This is also very close to (essentially really just a Protocol Buffer
018 * representation of) the "Expanded Term Definition" of the W3C's JSON-LD
019 * format.
020 *
021 * This obviously also looks a bit similar to Proto's Struct
022 * (see google/protobuf/struct.proto), with additional explicit Links.
023 *
024 * Cap’n Proto's interface types, which are passed by reference instead of value
025 * over its RPC protocol, also somewhat resemble the explicit links used here.
026 * </pre>
027 *
028 * Protobuf type {@code dev.enola.thing.Thing}
029 */
030@com.google.protobuf.Generated
031public final class Thing extends
032    com.google.protobuf.GeneratedMessage implements
033    // @@protoc_insertion_point(message_implements:dev.enola.thing.Thing)
034    ThingOrBuilder {
035private static final long serialVersionUID = 0L;
036  static {
037    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
038      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
039      /* major= */ 4,
040      /* minor= */ 32,
041      /* patch= */ 0,
042      /* suffix= */ "",
043      Thing.class.getName());
044  }
045  // Use Thing.newBuilder() to construct.
046  private Thing(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
047    super(builder);
048  }
049  private Thing() {
050    iri_ = "";
051  }
052
053  public static final com.google.protobuf.Descriptors.Descriptor
054      getDescriptor() {
055    return dev.enola.thing.proto.ThingOuterClass.internal_static_dev_enola_thing_Thing_descriptor;
056  }
057
058  @SuppressWarnings({"rawtypes"})
059  @java.lang.Override
060  protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
061      int number) {
062    switch (number) {
063      case 2:
064        return internalGetProperties();
065      default:
066        throw new RuntimeException(
067            "Invalid map field number: " + number);
068    }
069  }
070  @java.lang.Override
071  protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
072      internalGetFieldAccessorTable() {
073    return dev.enola.thing.proto.ThingOuterClass.internal_static_dev_enola_thing_Thing_fieldAccessorTable
074        .ensureFieldAccessorsInitialized(
075            dev.enola.thing.proto.Thing.class, dev.enola.thing.proto.Thing.Builder.class);
076  }
077
078  public static final int IRI_FIELD_NUMBER = 1;
079  @SuppressWarnings("serial")
080  private volatile java.lang.Object iri_ = "";
081  /**
082   * <pre>
083   * The IRI is often only set on the "top outer most", and may well be unset
084   * for things "contained" in other things (RDF calls this "blank nodes"). It's
085   * not even mandatory required for the "top outer most" one either.
086   * (TODO Why do we even need this?! Why not just use an
087   * https://schema.org/identifier field/attribute?)
088   * </pre>
089   *
090   * <code>string iri = 1;</code>
091   * @return The iri.
092   */
093  @java.lang.Override
094  public java.lang.String getIri() {
095    java.lang.Object ref = iri_;
096    if (ref instanceof java.lang.String) {
097      return (java.lang.String) ref;
098    } else {
099      com.google.protobuf.ByteString bs = 
100          (com.google.protobuf.ByteString) ref;
101      java.lang.String s = bs.toStringUtf8();
102      iri_ = s;
103      return s;
104    }
105  }
106  /**
107   * <pre>
108   * The IRI is often only set on the "top outer most", and may well be unset
109   * for things "contained" in other things (RDF calls this "blank nodes"). It's
110   * not even mandatory required for the "top outer most" one either.
111   * (TODO Why do we even need this?! Why not just use an
112   * https://schema.org/identifier field/attribute?)
113   * </pre>
114   *
115   * <code>string iri = 1;</code>
116   * @return The bytes for iri.
117   */
118  @java.lang.Override
119  public com.google.protobuf.ByteString
120      getIriBytes() {
121    java.lang.Object ref = iri_;
122    if (ref instanceof java.lang.String) {
123      com.google.protobuf.ByteString b = 
124          com.google.protobuf.ByteString.copyFromUtf8(
125              (java.lang.String) ref);
126      iri_ = b;
127      return b;
128    } else {
129      return (com.google.protobuf.ByteString) ref;
130    }
131  }
132
133  public static final int PROPERTIES_FIELD_NUMBER = 2;
134  private static final class PropertiesDefaultEntryHolder {
135    static final com.google.protobuf.MapEntry<
136        java.lang.String, dev.enola.thing.proto.Value> defaultEntry =
137            com.google.protobuf.MapEntry
138            .<java.lang.String, dev.enola.thing.proto.Value>newDefaultInstance(
139                dev.enola.thing.proto.ThingOuterClass.internal_static_dev_enola_thing_Thing_PropertiesEntry_descriptor, 
140                com.google.protobuf.WireFormat.FieldType.STRING,
141                "",
142                com.google.protobuf.WireFormat.FieldType.MESSAGE,
143                dev.enola.thing.proto.Value.getDefaultInstance());
144  }
145  @SuppressWarnings("serial")
146  private com.google.protobuf.MapField<
147      java.lang.String, dev.enola.thing.proto.Value> properties_;
148  private com.google.protobuf.MapField<java.lang.String, dev.enola.thing.proto.Value>
149  internalGetProperties() {
150    if (properties_ == null) {
151      return com.google.protobuf.MapField.emptyMapField(
152          PropertiesDefaultEntryHolder.defaultEntry);
153    }
154    return properties_;
155  }
156  public int getPropertiesCount() {
157    return internalGetProperties().getMap().size();
158  }
159  /**
160   * <pre>
161   * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
162   * (or even a “label”), but really an IRI. In theory such a Property IRI could
163   * be unique to only this single Thing; more typically, it is shared among
164   * things of the same type. Crucially though, it could also be an IRI of a
165   * property that is common among attributes of *different* types! Classic
166   * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
167   * </pre>
168   *
169   * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
170   */
171  @java.lang.Override
172  public boolean containsProperties(
173      java.lang.String key) {
174    if (key == null) { throw new NullPointerException("map key"); }
175    return internalGetProperties().getMap().containsKey(key);
176  }
177  /**
178   * Use {@link #getPropertiesMap()} instead.
179   */
180  @java.lang.Override
181  @java.lang.Deprecated
182  public java.util.Map<java.lang.String, dev.enola.thing.proto.Value> getProperties() {
183    return getPropertiesMap();
184  }
185  /**
186   * <pre>
187   * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
188   * (or even a “label”), but really an IRI. In theory such a Property IRI could
189   * be unique to only this single Thing; more typically, it is shared among
190   * things of the same type. Crucially though, it could also be an IRI of a
191   * property that is common among attributes of *different* types! Classic
192   * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
193   * </pre>
194   *
195   * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
196   */
197  @java.lang.Override
198  public java.util.Map<java.lang.String, dev.enola.thing.proto.Value> getPropertiesMap() {
199    return internalGetProperties().getMap();
200  }
201  /**
202   * <pre>
203   * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
204   * (or even a “label”), but really an IRI. In theory such a Property IRI could
205   * be unique to only this single Thing; more typically, it is shared among
206   * things of the same type. Crucially though, it could also be an IRI of a
207   * property that is common among attributes of *different* types! Classic
208   * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
209   * </pre>
210   *
211   * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
212   */
213  @java.lang.Override
214  public /* nullable */
215dev.enola.thing.proto.Value getPropertiesOrDefault(
216      java.lang.String key,
217      /* nullable */
218dev.enola.thing.proto.Value defaultValue) {
219    if (key == null) { throw new NullPointerException("map key"); }
220    java.util.Map<java.lang.String, dev.enola.thing.proto.Value> map =
221        internalGetProperties().getMap();
222    return map.containsKey(key) ? map.get(key) : defaultValue;
223  }
224  /**
225   * <pre>
226   * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
227   * (or even a “label”), but really an IRI. In theory such a Property IRI could
228   * be unique to only this single Thing; more typically, it is shared among
229   * things of the same type. Crucially though, it could also be an IRI of a
230   * property that is common among attributes of *different* types! Classic
231   * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
232   * </pre>
233   *
234   * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
235   */
236  @java.lang.Override
237  public dev.enola.thing.proto.Value getPropertiesOrThrow(
238      java.lang.String key) {
239    if (key == null) { throw new NullPointerException("map key"); }
240    java.util.Map<java.lang.String, dev.enola.thing.proto.Value> map =
241        internalGetProperties().getMap();
242    if (!map.containsKey(key)) {
243      throw new java.lang.IllegalArgumentException();
244    }
245    return map.get(key);
246  }
247
248  private byte memoizedIsInitialized = -1;
249  @java.lang.Override
250  public final boolean isInitialized() {
251    byte isInitialized = memoizedIsInitialized;
252    if (isInitialized == 1) return true;
253    if (isInitialized == 0) return false;
254
255    memoizedIsInitialized = 1;
256    return true;
257  }
258
259  @java.lang.Override
260  public void writeTo(com.google.protobuf.CodedOutputStream output)
261                      throws java.io.IOException {
262    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iri_)) {
263      com.google.protobuf.GeneratedMessage.writeString(output, 1, iri_);
264    }
265    com.google.protobuf.GeneratedMessage
266      .serializeStringMapTo(
267        output,
268        internalGetProperties(),
269        PropertiesDefaultEntryHolder.defaultEntry,
270        2);
271    getUnknownFields().writeTo(output);
272  }
273
274  @java.lang.Override
275  public int getSerializedSize() {
276    int size = memoizedSize;
277    if (size != -1) return size;
278
279    size = 0;
280    if (!com.google.protobuf.GeneratedMessage.isStringEmpty(iri_)) {
281      size += com.google.protobuf.GeneratedMessage.computeStringSize(1, iri_);
282    }
283    for (java.util.Map.Entry<java.lang.String, dev.enola.thing.proto.Value> entry
284         : internalGetProperties().getMap().entrySet()) {
285      com.google.protobuf.MapEntry<java.lang.String, dev.enola.thing.proto.Value>
286      properties__ = PropertiesDefaultEntryHolder.defaultEntry.newBuilderForType()
287          .setKey(entry.getKey())
288          .setValue(entry.getValue())
289          .build();
290      size += com.google.protobuf.CodedOutputStream
291          .computeMessageSize(2, properties__);
292    }
293    size += getUnknownFields().getSerializedSize();
294    memoizedSize = size;
295    return size;
296  }
297
298  @java.lang.Override
299  public boolean equals(final java.lang.Object obj) {
300    if (obj == this) {
301     return true;
302    }
303    if (!(obj instanceof dev.enola.thing.proto.Thing)) {
304      return super.equals(obj);
305    }
306    dev.enola.thing.proto.Thing other = (dev.enola.thing.proto.Thing) obj;
307
308    if (!getIri()
309        .equals(other.getIri())) return false;
310    if (!internalGetProperties().equals(
311        other.internalGetProperties())) return false;
312    if (!getUnknownFields().equals(other.getUnknownFields())) return false;
313    return true;
314  }
315
316  @java.lang.Override
317  public int hashCode() {
318    if (memoizedHashCode != 0) {
319      return memoizedHashCode;
320    }
321    int hash = 41;
322    hash = (19 * hash) + getDescriptor().hashCode();
323    hash = (37 * hash) + IRI_FIELD_NUMBER;
324    hash = (53 * hash) + getIri().hashCode();
325    if (!internalGetProperties().getMap().isEmpty()) {
326      hash = (37 * hash) + PROPERTIES_FIELD_NUMBER;
327      hash = (53 * hash) + internalGetProperties().hashCode();
328    }
329    hash = (29 * hash) + getUnknownFields().hashCode();
330    memoizedHashCode = hash;
331    return hash;
332  }
333
334  public static dev.enola.thing.proto.Thing parseFrom(
335      java.nio.ByteBuffer data)
336      throws com.google.protobuf.InvalidProtocolBufferException {
337    return PARSER.parseFrom(data);
338  }
339  public static dev.enola.thing.proto.Thing parseFrom(
340      java.nio.ByteBuffer data,
341      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
342      throws com.google.protobuf.InvalidProtocolBufferException {
343    return PARSER.parseFrom(data, extensionRegistry);
344  }
345  public static dev.enola.thing.proto.Thing parseFrom(
346      com.google.protobuf.ByteString data)
347      throws com.google.protobuf.InvalidProtocolBufferException {
348    return PARSER.parseFrom(data);
349  }
350  public static dev.enola.thing.proto.Thing parseFrom(
351      com.google.protobuf.ByteString data,
352      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
353      throws com.google.protobuf.InvalidProtocolBufferException {
354    return PARSER.parseFrom(data, extensionRegistry);
355  }
356  public static dev.enola.thing.proto.Thing parseFrom(byte[] data)
357      throws com.google.protobuf.InvalidProtocolBufferException {
358    return PARSER.parseFrom(data);
359  }
360  public static dev.enola.thing.proto.Thing parseFrom(
361      byte[] data,
362      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
363      throws com.google.protobuf.InvalidProtocolBufferException {
364    return PARSER.parseFrom(data, extensionRegistry);
365  }
366  public static dev.enola.thing.proto.Thing parseFrom(java.io.InputStream input)
367      throws java.io.IOException {
368    return com.google.protobuf.GeneratedMessage
369        .parseWithIOException(PARSER, input);
370  }
371  public static dev.enola.thing.proto.Thing parseFrom(
372      java.io.InputStream input,
373      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
374      throws java.io.IOException {
375    return com.google.protobuf.GeneratedMessage
376        .parseWithIOException(PARSER, input, extensionRegistry);
377  }
378
379  public static dev.enola.thing.proto.Thing parseDelimitedFrom(java.io.InputStream input)
380      throws java.io.IOException {
381    return com.google.protobuf.GeneratedMessage
382        .parseDelimitedWithIOException(PARSER, input);
383  }
384
385  public static dev.enola.thing.proto.Thing parseDelimitedFrom(
386      java.io.InputStream input,
387      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
388      throws java.io.IOException {
389    return com.google.protobuf.GeneratedMessage
390        .parseDelimitedWithIOException(PARSER, input, extensionRegistry);
391  }
392  public static dev.enola.thing.proto.Thing parseFrom(
393      com.google.protobuf.CodedInputStream input)
394      throws java.io.IOException {
395    return com.google.protobuf.GeneratedMessage
396        .parseWithIOException(PARSER, input);
397  }
398  public static dev.enola.thing.proto.Thing parseFrom(
399      com.google.protobuf.CodedInputStream input,
400      com.google.protobuf.ExtensionRegistryLite extensionRegistry)
401      throws java.io.IOException {
402    return com.google.protobuf.GeneratedMessage
403        .parseWithIOException(PARSER, input, extensionRegistry);
404  }
405
406  @java.lang.Override
407  public Builder newBuilderForType() { return newBuilder(); }
408  public static Builder newBuilder() {
409    return DEFAULT_INSTANCE.toBuilder();
410  }
411  public static Builder newBuilder(dev.enola.thing.proto.Thing prototype) {
412    return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
413  }
414  @java.lang.Override
415  public Builder toBuilder() {
416    return this == DEFAULT_INSTANCE
417        ? new Builder() : new Builder().mergeFrom(this);
418  }
419
420  @java.lang.Override
421  protected Builder newBuilderForType(
422      com.google.protobuf.GeneratedMessage.BuilderParent parent) {
423    Builder builder = new Builder(parent);
424    return builder;
425  }
426  /**
427   * <pre>
428   * Thing is a generic datastructure for Linked Data.
429   *
430   * It is inspired by the Resource Description Framework (RDF)
431   * and its Subject / Predicate / Object "Triples". It's however
432   * not "flat", but represents "Blank Nodes" as "Unlabeled Nested"
433   * sub-structures, which makes it resemble regular ProtoBuf / JSON / YAML.
434   *
435   * This is also very close to (essentially really just a Protocol Buffer
436   * representation of) the "Expanded Term Definition" of the W3C's JSON-LD
437   * format.
438   *
439   * This obviously also looks a bit similar to Proto's Struct
440   * (see google/protobuf/struct.proto), with additional explicit Links.
441   *
442   * Cap’n Proto's interface types, which are passed by reference instead of value
443   * over its RPC protocol, also somewhat resemble the explicit links used here.
444   * </pre>
445   *
446   * Protobuf type {@code dev.enola.thing.Thing}
447   */
448  public static final class Builder extends
449      com.google.protobuf.GeneratedMessage.Builder<Builder> implements
450      // @@protoc_insertion_point(builder_implements:dev.enola.thing.Thing)
451      dev.enola.thing.proto.ThingOrBuilder {
452    public static final com.google.protobuf.Descriptors.Descriptor
453        getDescriptor() {
454      return dev.enola.thing.proto.ThingOuterClass.internal_static_dev_enola_thing_Thing_descriptor;
455    }
456
457    @SuppressWarnings({"rawtypes"})
458    protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection(
459        int number) {
460      switch (number) {
461        case 2:
462          return internalGetProperties();
463        default:
464          throw new RuntimeException(
465              "Invalid map field number: " + number);
466      }
467    }
468    @SuppressWarnings({"rawtypes"})
469    protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection(
470        int number) {
471      switch (number) {
472        case 2:
473          return internalGetMutableProperties();
474        default:
475          throw new RuntimeException(
476              "Invalid map field number: " + number);
477      }
478    }
479    @java.lang.Override
480    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
481        internalGetFieldAccessorTable() {
482      return dev.enola.thing.proto.ThingOuterClass.internal_static_dev_enola_thing_Thing_fieldAccessorTable
483          .ensureFieldAccessorsInitialized(
484              dev.enola.thing.proto.Thing.class, dev.enola.thing.proto.Thing.Builder.class);
485    }
486
487    // Construct using dev.enola.thing.proto.Thing.newBuilder()
488    private Builder() {
489
490    }
491
492    private Builder(
493        com.google.protobuf.GeneratedMessage.BuilderParent parent) {
494      super(parent);
495
496    }
497    @java.lang.Override
498    public Builder clear() {
499      super.clear();
500      bitField0_ = 0;
501      iri_ = "";
502      internalGetMutableProperties().clear();
503      return this;
504    }
505
506    @java.lang.Override
507    public com.google.protobuf.Descriptors.Descriptor
508        getDescriptorForType() {
509      return dev.enola.thing.proto.ThingOuterClass.internal_static_dev_enola_thing_Thing_descriptor;
510    }
511
512    @java.lang.Override
513    public dev.enola.thing.proto.Thing getDefaultInstanceForType() {
514      return dev.enola.thing.proto.Thing.getDefaultInstance();
515    }
516
517    @java.lang.Override
518    public dev.enola.thing.proto.Thing build() {
519      dev.enola.thing.proto.Thing result = buildPartial();
520      if (!result.isInitialized()) {
521        throw newUninitializedMessageException(result);
522      }
523      return result;
524    }
525
526    @java.lang.Override
527    public dev.enola.thing.proto.Thing buildPartial() {
528      dev.enola.thing.proto.Thing result = new dev.enola.thing.proto.Thing(this);
529      if (bitField0_ != 0) { buildPartial0(result); }
530      onBuilt();
531      return result;
532    }
533
534    private void buildPartial0(dev.enola.thing.proto.Thing result) {
535      int from_bitField0_ = bitField0_;
536      if (((from_bitField0_ & 0x00000001) != 0)) {
537        result.iri_ = iri_;
538      }
539      if (((from_bitField0_ & 0x00000002) != 0)) {
540        result.properties_ = internalGetProperties().build(PropertiesDefaultEntryHolder.defaultEntry);
541      }
542    }
543
544    @java.lang.Override
545    public Builder mergeFrom(com.google.protobuf.Message other) {
546      if (other instanceof dev.enola.thing.proto.Thing) {
547        return mergeFrom((dev.enola.thing.proto.Thing)other);
548      } else {
549        super.mergeFrom(other);
550        return this;
551      }
552    }
553
554    public Builder mergeFrom(dev.enola.thing.proto.Thing other) {
555      if (other == dev.enola.thing.proto.Thing.getDefaultInstance()) return this;
556      if (!other.getIri().isEmpty()) {
557        iri_ = other.iri_;
558        bitField0_ |= 0x00000001;
559        onChanged();
560      }
561      internalGetMutableProperties().mergeFrom(
562          other.internalGetProperties());
563      bitField0_ |= 0x00000002;
564      this.mergeUnknownFields(other.getUnknownFields());
565      onChanged();
566      return this;
567    }
568
569    @java.lang.Override
570    public final boolean isInitialized() {
571      return true;
572    }
573
574    @java.lang.Override
575    public Builder mergeFrom(
576        com.google.protobuf.CodedInputStream input,
577        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
578        throws java.io.IOException {
579      if (extensionRegistry == null) {
580        throw new java.lang.NullPointerException();
581      }
582      try {
583        boolean done = false;
584        while (!done) {
585          int tag = input.readTag();
586          switch (tag) {
587            case 0:
588              done = true;
589              break;
590            case 10: {
591              iri_ = input.readStringRequireUtf8();
592              bitField0_ |= 0x00000001;
593              break;
594            } // case 10
595            case 18: {
596              com.google.protobuf.MapEntry<java.lang.String, dev.enola.thing.proto.Value>
597              properties__ = input.readMessage(
598                  PropertiesDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry);
599              internalGetMutableProperties().ensureBuilderMap().put(
600                  properties__.getKey(), properties__.getValue());
601              bitField0_ |= 0x00000002;
602              break;
603            } // case 18
604            default: {
605              if (!super.parseUnknownField(input, extensionRegistry, tag)) {
606                done = true; // was an endgroup tag
607              }
608              break;
609            } // default:
610          } // switch (tag)
611        } // while (!done)
612      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
613        throw e.unwrapIOException();
614      } finally {
615        onChanged();
616      } // finally
617      return this;
618    }
619    private int bitField0_;
620
621    private java.lang.Object iri_ = "";
622    /**
623     * <pre>
624     * The IRI is often only set on the "top outer most", and may well be unset
625     * for things "contained" in other things (RDF calls this "blank nodes"). It's
626     * not even mandatory required for the "top outer most" one either.
627     * (TODO Why do we even need this?! Why not just use an
628     * https://schema.org/identifier field/attribute?)
629     * </pre>
630     *
631     * <code>string iri = 1;</code>
632     * @return The iri.
633     */
634    public java.lang.String getIri() {
635      java.lang.Object ref = iri_;
636      if (!(ref instanceof java.lang.String)) {
637        com.google.protobuf.ByteString bs =
638            (com.google.protobuf.ByteString) ref;
639        java.lang.String s = bs.toStringUtf8();
640        iri_ = s;
641        return s;
642      } else {
643        return (java.lang.String) ref;
644      }
645    }
646    /**
647     * <pre>
648     * The IRI is often only set on the "top outer most", and may well be unset
649     * for things "contained" in other things (RDF calls this "blank nodes"). It's
650     * not even mandatory required for the "top outer most" one either.
651     * (TODO Why do we even need this?! Why not just use an
652     * https://schema.org/identifier field/attribute?)
653     * </pre>
654     *
655     * <code>string iri = 1;</code>
656     * @return The bytes for iri.
657     */
658    public com.google.protobuf.ByteString
659        getIriBytes() {
660      java.lang.Object ref = iri_;
661      if (ref instanceof String) {
662        com.google.protobuf.ByteString b = 
663            com.google.protobuf.ByteString.copyFromUtf8(
664                (java.lang.String) ref);
665        iri_ = b;
666        return b;
667      } else {
668        return (com.google.protobuf.ByteString) ref;
669      }
670    }
671    /**
672     * <pre>
673     * The IRI is often only set on the "top outer most", and may well be unset
674     * for things "contained" in other things (RDF calls this "blank nodes"). It's
675     * not even mandatory required for the "top outer most" one either.
676     * (TODO Why do we even need this?! Why not just use an
677     * https://schema.org/identifier field/attribute?)
678     * </pre>
679     *
680     * <code>string iri = 1;</code>
681     * @param value The iri to set.
682     * @return This builder for chaining.
683     */
684    public Builder setIri(
685        java.lang.String value) {
686      if (value == null) { throw new NullPointerException(); }
687      iri_ = value;
688      bitField0_ |= 0x00000001;
689      onChanged();
690      return this;
691    }
692    /**
693     * <pre>
694     * The IRI is often only set on the "top outer most", and may well be unset
695     * for things "contained" in other things (RDF calls this "blank nodes"). It's
696     * not even mandatory required for the "top outer most" one either.
697     * (TODO Why do we even need this?! Why not just use an
698     * https://schema.org/identifier field/attribute?)
699     * </pre>
700     *
701     * <code>string iri = 1;</code>
702     * @return This builder for chaining.
703     */
704    public Builder clearIri() {
705      iri_ = getDefaultInstance().getIri();
706      bitField0_ = (bitField0_ & ~0x00000001);
707      onChanged();
708      return this;
709    }
710    /**
711     * <pre>
712     * The IRI is often only set on the "top outer most", and may well be unset
713     * for things "contained" in other things (RDF calls this "blank nodes"). It's
714     * not even mandatory required for the "top outer most" one either.
715     * (TODO Why do we even need this?! Why not just use an
716     * https://schema.org/identifier field/attribute?)
717     * </pre>
718     *
719     * <code>string iri = 1;</code>
720     * @param value The bytes for iri to set.
721     * @return This builder for chaining.
722     */
723    public Builder setIriBytes(
724        com.google.protobuf.ByteString value) {
725      if (value == null) { throw new NullPointerException(); }
726      checkByteStringIsUtf8(value);
727      iri_ = value;
728      bitField0_ |= 0x00000001;
729      onChanged();
730      return this;
731    }
732
733    private static final class PropertiesConverter implements com.google.protobuf.MapFieldBuilder.Converter<java.lang.String, dev.enola.thing.proto.ValueOrBuilder, dev.enola.thing.proto.Value> {
734      @java.lang.Override
735      public dev.enola.thing.proto.Value build(dev.enola.thing.proto.ValueOrBuilder val) {
736        if (val instanceof dev.enola.thing.proto.Value) { return (dev.enola.thing.proto.Value) val; }
737        return ((dev.enola.thing.proto.Value.Builder) val).build();
738      }
739
740      @java.lang.Override
741      public com.google.protobuf.MapEntry<java.lang.String, dev.enola.thing.proto.Value> defaultEntry() {
742        return PropertiesDefaultEntryHolder.defaultEntry;
743      }
744    };
745    private static final PropertiesConverter propertiesConverter = new PropertiesConverter();
746
747    private com.google.protobuf.MapFieldBuilder<
748        java.lang.String, dev.enola.thing.proto.ValueOrBuilder, dev.enola.thing.proto.Value, dev.enola.thing.proto.Value.Builder> properties_;
749    private com.google.protobuf.MapFieldBuilder<java.lang.String, dev.enola.thing.proto.ValueOrBuilder, dev.enola.thing.proto.Value, dev.enola.thing.proto.Value.Builder>
750        internalGetProperties() {
751      if (properties_ == null) {
752        return new com.google.protobuf.MapFieldBuilder<>(propertiesConverter);
753      }
754      return properties_;
755    }
756    private com.google.protobuf.MapFieldBuilder<java.lang.String, dev.enola.thing.proto.ValueOrBuilder, dev.enola.thing.proto.Value, dev.enola.thing.proto.Value.Builder>
757        internalGetMutableProperties() {
758      if (properties_ == null) {
759        properties_ = new com.google.protobuf.MapFieldBuilder<>(propertiesConverter);
760      }
761      bitField0_ |= 0x00000002;
762      onChanged();
763      return properties_;
764    }
765    public int getPropertiesCount() {
766      return internalGetProperties().ensureBuilderMap().size();
767    }
768    /**
769     * <pre>
770     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
771     * (or even a “label”), but really an IRI. In theory such a Property IRI could
772     * be unique to only this single Thing; more typically, it is shared among
773     * things of the same type. Crucially though, it could also be an IRI of a
774     * property that is common among attributes of *different* types! Classic
775     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
776     * </pre>
777     *
778     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
779     */
780    @java.lang.Override
781    public boolean containsProperties(
782        java.lang.String key) {
783      if (key == null) { throw new NullPointerException("map key"); }
784      return internalGetProperties().ensureBuilderMap().containsKey(key);
785    }
786    /**
787     * Use {@link #getPropertiesMap()} instead.
788     */
789    @java.lang.Override
790    @java.lang.Deprecated
791    public java.util.Map<java.lang.String, dev.enola.thing.proto.Value> getProperties() {
792      return getPropertiesMap();
793    }
794    /**
795     * <pre>
796     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
797     * (or even a “label”), but really an IRI. In theory such a Property IRI could
798     * be unique to only this single Thing; more typically, it is shared among
799     * things of the same type. Crucially though, it could also be an IRI of a
800     * property that is common among attributes of *different* types! Classic
801     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
802     * </pre>
803     *
804     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
805     */
806    @java.lang.Override
807    public java.util.Map<java.lang.String, dev.enola.thing.proto.Value> getPropertiesMap() {
808      return internalGetProperties().getImmutableMap();
809    }
810    /**
811     * <pre>
812     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
813     * (or even a “label”), but really an IRI. In theory such a Property IRI could
814     * be unique to only this single Thing; more typically, it is shared among
815     * things of the same type. Crucially though, it could also be an IRI of a
816     * property that is common among attributes of *different* types! Classic
817     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
818     * </pre>
819     *
820     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
821     */
822    @java.lang.Override
823    public /* nullable */
824dev.enola.thing.proto.Value getPropertiesOrDefault(
825        java.lang.String key,
826        /* nullable */
827dev.enola.thing.proto.Value defaultValue) {
828      if (key == null) { throw new NullPointerException("map key"); }
829      java.util.Map<java.lang.String, dev.enola.thing.proto.ValueOrBuilder> map = internalGetMutableProperties().ensureBuilderMap();
830      return map.containsKey(key) ? propertiesConverter.build(map.get(key)) : defaultValue;
831    }
832    /**
833     * <pre>
834     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
835     * (or even a “label”), but really an IRI. In theory such a Property IRI could
836     * be unique to only this single Thing; more typically, it is shared among
837     * things of the same type. Crucially though, it could also be an IRI of a
838     * property that is common among attributes of *different* types! Classic
839     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
840     * </pre>
841     *
842     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
843     */
844    @java.lang.Override
845    public dev.enola.thing.proto.Value getPropertiesOrThrow(
846        java.lang.String key) {
847      if (key == null) { throw new NullPointerException("map key"); }
848      java.util.Map<java.lang.String, dev.enola.thing.proto.ValueOrBuilder> map = internalGetMutableProperties().ensureBuilderMap();
849      if (!map.containsKey(key)) {
850        throw new java.lang.IllegalArgumentException();
851      }
852      return propertiesConverter.build(map.get(key));
853    }
854    public Builder clearProperties() {
855      bitField0_ = (bitField0_ & ~0x00000002);
856      internalGetMutableProperties().clear();
857      return this;
858    }
859    /**
860     * <pre>
861     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
862     * (or even a “label”), but really an IRI. In theory such a Property IRI could
863     * be unique to only this single Thing; more typically, it is shared among
864     * things of the same type. Crucially though, it could also be an IRI of a
865     * property that is common among attributes of *different* types! Classic
866     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
867     * </pre>
868     *
869     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
870     */
871    public Builder removeProperties(
872        java.lang.String key) {
873      if (key == null) { throw new NullPointerException("map key"); }
874      internalGetMutableProperties().ensureBuilderMap()
875          .remove(key);
876      return this;
877    }
878    /**
879     * Use alternate mutation accessors instead.
880     */
881    @java.lang.Deprecated
882    public java.util.Map<java.lang.String, dev.enola.thing.proto.Value>
883        getMutableProperties() {
884      bitField0_ |= 0x00000002;
885      return internalGetMutableProperties().ensureMessageMap();
886    }
887    /**
888     * <pre>
889     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
890     * (or even a “label”), but really an IRI. In theory such a Property IRI could
891     * be unique to only this single Thing; more typically, it is shared among
892     * things of the same type. Crucially though, it could also be an IRI of a
893     * property that is common among attributes of *different* types! Classic
894     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
895     * </pre>
896     *
897     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
898     */
899    public Builder putProperties(
900        java.lang.String key,
901        dev.enola.thing.proto.Value value) {
902      if (key == null) { throw new NullPointerException("map key"); }
903      if (value == null) { throw new NullPointerException("map value"); }
904      internalGetMutableProperties().ensureBuilderMap()
905          .put(key, value);
906      bitField0_ |= 0x00000002;
907      return this;
908    }
909    /**
910     * <pre>
911     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
912     * (or even a “label”), but really an IRI. In theory such a Property IRI could
913     * be unique to only this single Thing; more typically, it is shared among
914     * things of the same type. Crucially though, it could also be an IRI of a
915     * property that is common among attributes of *different* types! Classic
916     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
917     * </pre>
918     *
919     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
920     */
921    public Builder putAllProperties(
922        java.util.Map<java.lang.String, dev.enola.thing.proto.Value> values) {
923      for (java.util.Map.Entry<java.lang.String, dev.enola.thing.proto.Value> e : values.entrySet()) {
924        if (e.getKey() == null || e.getValue() == null) {
925          throw new NullPointerException();
926        }
927      }
928      internalGetMutableProperties().ensureBuilderMap()
929          .putAll(values);
930      bitField0_ |= 0x00000002;
931      return this;
932    }
933    /**
934     * <pre>
935     * Key string is an IRI (of a "property"). Nota Bene: This is never a “name”
936     * (or even a “label”), but really an IRI. In theory such a Property IRI could
937     * be unique to only this single Thing; more typically, it is shared among
938     * things of the same type. Crucially though, it could also be an IRI of a
939     * property that is common among attributes of *different* types! Classic
940     * examples are e.g. https://schema.org/name (rdfs:label 🏷️) or rdf:type.
941     * </pre>
942     *
943     * <code>map&lt;string, .dev.enola.thing.Value&gt; properties = 2;</code>
944     */
945    public dev.enola.thing.proto.Value.Builder putPropertiesBuilderIfAbsent(
946        java.lang.String key) {
947      java.util.Map<java.lang.String, dev.enola.thing.proto.ValueOrBuilder> builderMap = internalGetMutableProperties().ensureBuilderMap();
948      dev.enola.thing.proto.ValueOrBuilder entry = builderMap.get(key);
949      if (entry == null) {
950        entry = dev.enola.thing.proto.Value.newBuilder();
951        builderMap.put(key, entry);
952      }
953      if (entry instanceof dev.enola.thing.proto.Value) {
954        entry = ((dev.enola.thing.proto.Value) entry).toBuilder();
955        builderMap.put(key, entry);
956      }
957      return (dev.enola.thing.proto.Value.Builder) entry;
958    }
959
960    // @@protoc_insertion_point(builder_scope:dev.enola.thing.Thing)
961  }
962
963  // @@protoc_insertion_point(class_scope:dev.enola.thing.Thing)
964  private static final dev.enola.thing.proto.Thing DEFAULT_INSTANCE;
965  static {
966    DEFAULT_INSTANCE = new dev.enola.thing.proto.Thing();
967  }
968
969  public static dev.enola.thing.proto.Thing getDefaultInstance() {
970    return DEFAULT_INSTANCE;
971  }
972
973  private static final com.google.protobuf.Parser<Thing>
974      PARSER = new com.google.protobuf.AbstractParser<Thing>() {
975    @java.lang.Override
976    public Thing parsePartialFrom(
977        com.google.protobuf.CodedInputStream input,
978        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
979        throws com.google.protobuf.InvalidProtocolBufferException {
980      Builder builder = newBuilder();
981      try {
982        builder.mergeFrom(input, extensionRegistry);
983      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
984        throw e.setUnfinishedMessage(builder.buildPartial());
985      } catch (com.google.protobuf.UninitializedMessageException e) {
986        throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial());
987      } catch (java.io.IOException e) {
988        throw new com.google.protobuf.InvalidProtocolBufferException(e)
989            .setUnfinishedMessage(builder.buildPartial());
990      }
991      return builder.buildPartial();
992    }
993  };
994
995  public static com.google.protobuf.Parser<Thing> parser() {
996    return PARSER;
997  }
998
999  @java.lang.Override
1000  public com.google.protobuf.Parser<Thing> getParserForType() {
1001    return PARSER;
1002  }
1003
1004  @java.lang.Override
1005  public dev.enola.thing.proto.Thing getDefaultInstanceForType() {
1006    return DEFAULT_INSTANCE;
1007  }
1008
1009}
1010