// Path: src/main/java/com/squareup/protoparser/Utils.java
// static <T> T checkNotNull(T value, String name) {
//   if (value == null) {
//     throw new NullPointerException(name + " == null");
//   }
//   return value;
// }


import java.util.Locale;
import static com.squareup.protoparser.Utils.checkNotNull;
// Copyright 2015 Square, Inc.
package com.squareup.protoparser;



/**
 * Representation of a scalar, map, or named type. While this class is an interface, only the
 * included implementations are supported.
 */
public interface DataType {
  enum Kind {
    /** Type is a {@link ScalarType}. */
    SCALAR,
    /** Type is a {@link MapType}. */
    MAP,
    /** Type is a {@link NamedType}. */
    NAMED
  }

  /** The kind of this type (and therefore implementing class). */
  Kind kind();

  enum ScalarType implements DataType {
    ANY,
    BOOL,
    BYTES,
    DOUBLE,
    FLOAT,
    FIXED32,
    FIXED64,
    INT32,
    INT64,
    SFIXED32,
    SFIXED64,
    SINT32,
    SINT64,
    STRING,
    UINT32,
    UINT64;

    @Override public Kind kind() {
      return Kind.SCALAR;
    }

    @Override public String toString() {
      return name().toLowerCase(Locale.US);
    }
  }

  final class MapType implements DataType {
    public static MapType create(DataType keyType, DataType valueType) {
// Path: src/main/java/com/squareup/protoparser/Utils.java
// static <T> T checkNotNull(T value, String name) {
//   if (value == null) {
//     throw new NullPointerException(name + " == null");
//   }
//   return value;
// }


// Path: src/main/java/com/squareup/protoparser/DataType.java
import java.util.Locale;
import static com.squareup.protoparser.Utils.checkNotNull;

// Copyright 2015 Square, Inc.
package com.squareup.protoparser;



/**
 * Representation of a scalar, map, or named type. While this class is an interface, only the
 * included implementations are supported.
 */
public interface DataType {
  enum Kind {
    /** Type is a {@link ScalarType}. */
    SCALAR,
    /** Type is a {@link MapType}. */
    MAP,
    /** Type is a {@link NamedType}. */
    NAMED
  }

  /** The kind of this type (and therefore implementing class). */
  Kind kind();

  enum ScalarType implements DataType {
    ANY,
    BOOL,
    BYTES,
    DOUBLE,
    FLOAT,
    FIXED32,
    FIXED64,
    INT32,
    INT64,
    SFIXED32,
    SFIXED64,
    SINT32,
    SINT64,
    STRING,
    UINT32,
    UINT64;

    @Override public Kind kind() {
      return Kind.SCALAR;
    }

    @Override public String toString() {
      return name().toLowerCase(Locale.US);
    }
  }

  final class MapType implements DataType {
    public static MapType create(DataType keyType, DataType valueType) {
      return new MapType(checkNotNull(keyType, "keyType"), checkNotNull(valueType, "valueType"));