All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.squareup.protoparser.ProtoFile Maven / Gradle / Ivy

There is a newer version: 9.1.7.Final
Show newest version
// Copyright 2013 Square, Inc.
package com.squareup.protoparser;

import java.util.ArrayList;
import java.util.List;

import static java.util.Collections.unmodifiableList;

/** A single {@code .proto} file. */
public final class ProtoFile {
  public static final int MIN_TAG_VALUE = 1;
  public static final int MAX_TAG_VALUE = (1 << 29) - 1; // 536,870,911
  private static final int RESERVED_TAG_VALUE_START = 19000;
  private static final int RESERVED_TAG_VALUE_END = 19999;

  /** True if the supplied value is in the valid tag range and not reserved. */
  public static boolean isValidTag(int value) {
    return (value >= MIN_TAG_VALUE && value < RESERVED_TAG_VALUE_START)
        || (value > RESERVED_TAG_VALUE_END && value <= MAX_TAG_VALUE);
  }

  private final String fileName;
  private final String packageName;
  private final List dependencies;
  private final List publicDependencies;
  private final List types;
  private final List services;
  private final List




© 2015 - 2025 Weber Informatics LLC | Privacy Policy