Пример #1
0
 /**
  * <code>optional .dossier.Comment content = 3;</code>
  *
  * <pre>
  * The page content, if any.
  * </pre>
  */
 public Builder mergeContent(com.github.jsdossier.proto.Comment value) {
   if (contentBuilder_ == null) {
     if (((bitField0_ & 0x00000004) == 0x00000004)
         && content_ != com.github.jsdossier.proto.Comment.getDefaultInstance()) {
       content_ =
           com.github.jsdossier.proto.Comment.newBuilder(content_)
               .mergeFrom(value)
               .buildPartial();
     } else {
       content_ = value;
     }
     onChanged();
   } else {
     contentBuilder_.mergeFrom(value);
   }
   bitField0_ |= 0x00000004;
   return this;
 }
Пример #2
0
 /**
  * <code>optional .dossier.Comment content = 3;</code>
  *
  * <pre>
  * The page content, if any.
  * </pre>
  */
 public Builder clearContent() {
   if (contentBuilder_ == null) {
     content_ = com.github.jsdossier.proto.Comment.getDefaultInstance();
     onChanged();
   } else {
     contentBuilder_.clear();
   }
   bitField0_ = (bitField0_ & ~0x00000004);
   return this;
 }
Пример #3
0
 public Builder clear() {
   super.clear();
   if (resourcesBuilder_ == null) {
     resources_ = com.github.jsdossier.proto.Resources.getDefaultInstance();
   } else {
     resourcesBuilder_.clear();
   }
   bitField0_ = (bitField0_ & ~0x00000001);
   title_ = "";
   bitField0_ = (bitField0_ & ~0x00000002);
   if (contentBuilder_ == null) {
     content_ = com.github.jsdossier.proto.Comment.getDefaultInstance();
   } else {
     contentBuilder_.clear();
   }
   bitField0_ = (bitField0_ & ~0x00000004);
   if (indexBuilder_ == null) {
     index_ = com.github.jsdossier.proto.Index.getDefaultInstance();
   } else {
     indexBuilder_.clear();
   }
   bitField0_ = (bitField0_ & ~0x00000008);
   return this;
 }
Пример #4
0
  /**
   * Protobuf type {@code dossier.HtmlRenderSpec}
   *
   * <pre>
   * Describes how to render a generic HTML page.
   * </pre>
   */
  public static final class Builder extends com.google.protobuf.GeneratedMessage.Builder<Builder>
      implements
      // @@protoc_insertion_point(builder_implements:dossier.HtmlRenderSpec)
      com.github.jsdossier.proto.HtmlRenderSpecOrBuilder {
    public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
      return com.github.jsdossier.proto.Dossier.internal_static_dossier_HtmlRenderSpec_descriptor;
    }

    protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
        internalGetFieldAccessorTable() {
      return com.github.jsdossier.proto.Dossier
          .internal_static_dossier_HtmlRenderSpec_fieldAccessorTable
          .ensureFieldAccessorsInitialized(
              com.github.jsdossier.proto.HtmlRenderSpec.class,
              com.github.jsdossier.proto.HtmlRenderSpec.Builder.class);
    }

    // Construct using com.github.jsdossier.proto.HtmlRenderSpec.newBuilder()
    private Builder() {
      maybeForceBuilderInitialization();
    }

    private Builder(com.google.protobuf.GeneratedMessage.BuilderParent parent) {
      super(parent);
      maybeForceBuilderInitialization();
    }

    private void maybeForceBuilderInitialization() {
      if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
        getResourcesFieldBuilder();
        getContentFieldBuilder();
        getIndexFieldBuilder();
      }
    }

    private static Builder create() {
      return new Builder();
    }

    public Builder clear() {
      super.clear();
      if (resourcesBuilder_ == null) {
        resources_ = com.github.jsdossier.proto.Resources.getDefaultInstance();
      } else {
        resourcesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      title_ = "";
      bitField0_ = (bitField0_ & ~0x00000002);
      if (contentBuilder_ == null) {
        content_ = com.github.jsdossier.proto.Comment.getDefaultInstance();
      } else {
        contentBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000004);
      if (indexBuilder_ == null) {
        index_ = com.github.jsdossier.proto.Index.getDefaultInstance();
      } else {
        indexBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000008);
      return this;
    }

    public Builder clone() {
      return create().mergeFrom(buildPartial());
    }

    public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
      return com.github.jsdossier.proto.Dossier.internal_static_dossier_HtmlRenderSpec_descriptor;
    }

    public com.github.jsdossier.proto.HtmlRenderSpec getDefaultInstanceForType() {
      return com.github.jsdossier.proto.HtmlRenderSpec.getDefaultInstance();
    }

    public com.github.jsdossier.proto.HtmlRenderSpec build() {
      com.github.jsdossier.proto.HtmlRenderSpec result = buildPartial();
      if (!result.isInitialized()) {
        throw newUninitializedMessageException(result);
      }
      return result;
    }

    public com.github.jsdossier.proto.HtmlRenderSpec buildPartial() {
      com.github.jsdossier.proto.HtmlRenderSpec result =
          new com.github.jsdossier.proto.HtmlRenderSpec(this);
      int from_bitField0_ = bitField0_;
      int to_bitField0_ = 0;
      if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
        to_bitField0_ |= 0x00000001;
      }
      if (resourcesBuilder_ == null) {
        result.resources_ = resources_;
      } else {
        result.resources_ = resourcesBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
        to_bitField0_ |= 0x00000002;
      }
      result.title_ = title_;
      if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
        to_bitField0_ |= 0x00000004;
      }
      if (contentBuilder_ == null) {
        result.content_ = content_;
      } else {
        result.content_ = contentBuilder_.build();
      }
      if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
        to_bitField0_ |= 0x00000008;
      }
      if (indexBuilder_ == null) {
        result.index_ = index_;
      } else {
        result.index_ = indexBuilder_.build();
      }
      result.bitField0_ = to_bitField0_;
      onBuilt();
      return result;
    }

    public Builder mergeFrom(com.google.protobuf.Message other) {
      if (other instanceof com.github.jsdossier.proto.HtmlRenderSpec) {
        return mergeFrom((com.github.jsdossier.proto.HtmlRenderSpec) other);
      } else {
        super.mergeFrom(other);
        return this;
      }
    }

    public Builder mergeFrom(com.github.jsdossier.proto.HtmlRenderSpec other) {
      if (other == com.github.jsdossier.proto.HtmlRenderSpec.getDefaultInstance()) return this;
      if (other.hasResources()) {
        mergeResources(other.getResources());
      }
      if (other.hasTitle()) {
        bitField0_ |= 0x00000002;
        title_ = other.title_;
        onChanged();
      }
      if (other.hasContent()) {
        mergeContent(other.getContent());
      }
      if (other.hasIndex()) {
        mergeIndex(other.getIndex());
      }
      this.mergeUnknownFields(other.getUnknownFields());
      return this;
    }

    public final boolean isInitialized() {
      if (!hasResources()) {

        return false;
      }
      if (!hasTitle()) {

        return false;
      }
      if (!hasIndex()) {

        return false;
      }
      if (!getIndex().isInitialized()) {

        return false;
      }
      return true;
    }

    public Builder mergeFrom(
        com.google.protobuf.CodedInputStream input,
        com.google.protobuf.ExtensionRegistryLite extensionRegistry)
        throws java.io.IOException {
      com.github.jsdossier.proto.HtmlRenderSpec parsedMessage = null;
      try {
        parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
      } catch (com.google.protobuf.InvalidProtocolBufferException e) {
        parsedMessage = (com.github.jsdossier.proto.HtmlRenderSpec) e.getUnfinishedMessage();
        throw e;
      } finally {
        if (parsedMessage != null) {
          mergeFrom(parsedMessage);
        }
      }
      return this;
    }

    private int bitField0_;

    private com.github.jsdossier.proto.Resources resources_ =
        com.github.jsdossier.proto.Resources.getDefaultInstance();
    private com.google.protobuf.SingleFieldBuilder<
            com.github.jsdossier.proto.Resources,
            com.github.jsdossier.proto.Resources.Builder,
            com.github.jsdossier.proto.ResourcesOrBuilder>
        resourcesBuilder_;
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public boolean hasResources() {
      return ((bitField0_ & 0x00000001) == 0x00000001);
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public com.github.jsdossier.proto.Resources getResources() {
      if (resourcesBuilder_ == null) {
        return resources_;
      } else {
        return resourcesBuilder_.getMessage();
      }
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public Builder setResources(com.github.jsdossier.proto.Resources value) {
      if (resourcesBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        resources_ = value;
        onChanged();
      } else {
        resourcesBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000001;
      return this;
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public Builder setResources(com.github.jsdossier.proto.Resources.Builder builderForValue) {
      if (resourcesBuilder_ == null) {
        resources_ = builderForValue.build();
        onChanged();
      } else {
        resourcesBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000001;
      return this;
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public Builder mergeResources(com.github.jsdossier.proto.Resources value) {
      if (resourcesBuilder_ == null) {
        if (((bitField0_ & 0x00000001) == 0x00000001)
            && resources_ != com.github.jsdossier.proto.Resources.getDefaultInstance()) {
          resources_ =
              com.github.jsdossier.proto.Resources.newBuilder(resources_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          resources_ = value;
        }
        onChanged();
      } else {
        resourcesBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000001;
      return this;
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public Builder clearResources() {
      if (resourcesBuilder_ == null) {
        resources_ = com.github.jsdossier.proto.Resources.getDefaultInstance();
        onChanged();
      } else {
        resourcesBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000001);
      return this;
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public com.github.jsdossier.proto.Resources.Builder getResourcesBuilder() {
      bitField0_ |= 0x00000001;
      onChanged();
      return getResourcesFieldBuilder().getBuilder();
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    public com.github.jsdossier.proto.ResourcesOrBuilder getResourcesOrBuilder() {
      if (resourcesBuilder_ != null) {
        return resourcesBuilder_.getMessageOrBuilder();
      } else {
        return resources_;
      }
    }
    /**
     * <code>required .dossier.Resources resources = 1;</code>
     *
     * <pre>
     * The resources to include.
     * </pre>
     */
    private com.google.protobuf.SingleFieldBuilder<
            com.github.jsdossier.proto.Resources,
            com.github.jsdossier.proto.Resources.Builder,
            com.github.jsdossier.proto.ResourcesOrBuilder>
        getResourcesFieldBuilder() {
      if (resourcesBuilder_ == null) {
        resourcesBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                com.github.jsdossier.proto.Resources,
                com.github.jsdossier.proto.Resources.Builder,
                com.github.jsdossier.proto.ResourcesOrBuilder>(
                getResources(), getParentForChildren(), isClean());
        resources_ = null;
      }
      return resourcesBuilder_;
    }

    private java.lang.Object title_ = "";
    /**
     * <code>required string title = 2;</code>
     *
     * <pre>
     * The page title.
     * </pre>
     */
    public boolean hasTitle() {
      return ((bitField0_ & 0x00000002) == 0x00000002);
    }
    /**
     * <code>required string title = 2;</code>
     *
     * <pre>
     * The page title.
     * </pre>
     */
    public java.lang.String getTitle() {
      java.lang.Object ref = title_;
      if (!(ref instanceof java.lang.String)) {
        com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
        java.lang.String s = bs.toStringUtf8();
        if (bs.isValidUtf8()) {
          title_ = s;
        }
        return s;
      } else {
        return (java.lang.String) ref;
      }
    }
    /**
     * <code>required string title = 2;</code>
     *
     * <pre>
     * The page title.
     * </pre>
     */
    public com.google.protobuf.ByteString getTitleBytes() {
      java.lang.Object ref = title_;
      if (ref instanceof String) {
        com.google.protobuf.ByteString b =
            com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
        title_ = b;
        return b;
      } else {
        return (com.google.protobuf.ByteString) ref;
      }
    }
    /**
     * <code>required string title = 2;</code>
     *
     * <pre>
     * The page title.
     * </pre>
     */
    public Builder setTitle(java.lang.String value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000002;
      title_ = value;
      onChanged();
      return this;
    }
    /**
     * <code>required string title = 2;</code>
     *
     * <pre>
     * The page title.
     * </pre>
     */
    public Builder clearTitle() {
      bitField0_ = (bitField0_ & ~0x00000002);
      title_ = getDefaultInstance().getTitle();
      onChanged();
      return this;
    }
    /**
     * <code>required string title = 2;</code>
     *
     * <pre>
     * The page title.
     * </pre>
     */
    public Builder setTitleBytes(com.google.protobuf.ByteString value) {
      if (value == null) {
        throw new NullPointerException();
      }
      bitField0_ |= 0x00000002;
      title_ = value;
      onChanged();
      return this;
    }

    private com.github.jsdossier.proto.Comment content_ =
        com.github.jsdossier.proto.Comment.getDefaultInstance();
    private com.google.protobuf.SingleFieldBuilder<
            com.github.jsdossier.proto.Comment,
            com.github.jsdossier.proto.Comment.Builder,
            com.github.jsdossier.proto.CommentOrBuilder>
        contentBuilder_;
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public boolean hasContent() {
      return ((bitField0_ & 0x00000004) == 0x00000004);
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public com.github.jsdossier.proto.Comment getContent() {
      if (contentBuilder_ == null) {
        return content_;
      } else {
        return contentBuilder_.getMessage();
      }
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public Builder setContent(com.github.jsdossier.proto.Comment value) {
      if (contentBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        content_ = value;
        onChanged();
      } else {
        contentBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000004;
      return this;
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public Builder setContent(com.github.jsdossier.proto.Comment.Builder builderForValue) {
      if (contentBuilder_ == null) {
        content_ = builderForValue.build();
        onChanged();
      } else {
        contentBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000004;
      return this;
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public Builder mergeContent(com.github.jsdossier.proto.Comment value) {
      if (contentBuilder_ == null) {
        if (((bitField0_ & 0x00000004) == 0x00000004)
            && content_ != com.github.jsdossier.proto.Comment.getDefaultInstance()) {
          content_ =
              com.github.jsdossier.proto.Comment.newBuilder(content_)
                  .mergeFrom(value)
                  .buildPartial();
        } else {
          content_ = value;
        }
        onChanged();
      } else {
        contentBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000004;
      return this;
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public Builder clearContent() {
      if (contentBuilder_ == null) {
        content_ = com.github.jsdossier.proto.Comment.getDefaultInstance();
        onChanged();
      } else {
        contentBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000004);
      return this;
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public com.github.jsdossier.proto.Comment.Builder getContentBuilder() {
      bitField0_ |= 0x00000004;
      onChanged();
      return getContentFieldBuilder().getBuilder();
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    public com.github.jsdossier.proto.CommentOrBuilder getContentOrBuilder() {
      if (contentBuilder_ != null) {
        return contentBuilder_.getMessageOrBuilder();
      } else {
        return content_;
      }
    }
    /**
     * <code>optional .dossier.Comment content = 3;</code>
     *
     * <pre>
     * The page content, if any.
     * </pre>
     */
    private com.google.protobuf.SingleFieldBuilder<
            com.github.jsdossier.proto.Comment,
            com.github.jsdossier.proto.Comment.Builder,
            com.github.jsdossier.proto.CommentOrBuilder>
        getContentFieldBuilder() {
      if (contentBuilder_ == null) {
        contentBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                com.github.jsdossier.proto.Comment,
                com.github.jsdossier.proto.Comment.Builder,
                com.github.jsdossier.proto.CommentOrBuilder>(
                getContent(), getParentForChildren(), isClean());
        content_ = null;
      }
      return contentBuilder_;
    }

    private com.github.jsdossier.proto.Index index_ =
        com.github.jsdossier.proto.Index.getDefaultInstance();
    private com.google.protobuf.SingleFieldBuilder<
            com.github.jsdossier.proto.Index,
            com.github.jsdossier.proto.Index.Builder,
            com.github.jsdossier.proto.IndexOrBuilder>
        indexBuilder_;
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public boolean hasIndex() {
      return ((bitField0_ & 0x00000008) == 0x00000008);
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public com.github.jsdossier.proto.Index getIndex() {
      if (indexBuilder_ == null) {
        return index_;
      } else {
        return indexBuilder_.getMessage();
      }
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public Builder setIndex(com.github.jsdossier.proto.Index value) {
      if (indexBuilder_ == null) {
        if (value == null) {
          throw new NullPointerException();
        }
        index_ = value;
        onChanged();
      } else {
        indexBuilder_.setMessage(value);
      }
      bitField0_ |= 0x00000008;
      return this;
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public Builder setIndex(com.github.jsdossier.proto.Index.Builder builderForValue) {
      if (indexBuilder_ == null) {
        index_ = builderForValue.build();
        onChanged();
      } else {
        indexBuilder_.setMessage(builderForValue.build());
      }
      bitField0_ |= 0x00000008;
      return this;
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public Builder mergeIndex(com.github.jsdossier.proto.Index value) {
      if (indexBuilder_ == null) {
        if (((bitField0_ & 0x00000008) == 0x00000008)
            && index_ != com.github.jsdossier.proto.Index.getDefaultInstance()) {
          index_ =
              com.github.jsdossier.proto.Index.newBuilder(index_).mergeFrom(value).buildPartial();
        } else {
          index_ = value;
        }
        onChanged();
      } else {
        indexBuilder_.mergeFrom(value);
      }
      bitField0_ |= 0x00000008;
      return this;
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public Builder clearIndex() {
      if (indexBuilder_ == null) {
        index_ = com.github.jsdossier.proto.Index.getDefaultInstance();
        onChanged();
      } else {
        indexBuilder_.clear();
      }
      bitField0_ = (bitField0_ & ~0x00000008);
      return this;
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public com.github.jsdossier.proto.Index.Builder getIndexBuilder() {
      bitField0_ |= 0x00000008;
      onChanged();
      return getIndexFieldBuilder().getBuilder();
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    public com.github.jsdossier.proto.IndexOrBuilder getIndexOrBuilder() {
      if (indexBuilder_ != null) {
        return indexBuilder_.getMessageOrBuilder();
      } else {
        return index_;
      }
    }
    /**
     * <code>required .dossier.Index index = 4;</code>
     *
     * <pre>
     * Navigation index.
     * </pre>
     */
    private com.google.protobuf.SingleFieldBuilder<
            com.github.jsdossier.proto.Index,
            com.github.jsdossier.proto.Index.Builder,
            com.github.jsdossier.proto.IndexOrBuilder>
        getIndexFieldBuilder() {
      if (indexBuilder_ == null) {
        indexBuilder_ =
            new com.google.protobuf.SingleFieldBuilder<
                com.github.jsdossier.proto.Index,
                com.github.jsdossier.proto.Index.Builder,
                com.github.jsdossier.proto.IndexOrBuilder>(
                getIndex(), getParentForChildren(), isClean());
        index_ = null;
      }
      return indexBuilder_;
    }

    // @@protoc_insertion_point(builder_scope:dossier.HtmlRenderSpec)
  }
Пример #5
0
 private void initFields() {
   resources_ = com.github.jsdossier.proto.Resources.getDefaultInstance();
   title_ = "";
   content_ = com.github.jsdossier.proto.Comment.getDefaultInstance();
   index_ = com.github.jsdossier.proto.Index.getDefaultInstance();
 }