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

org.checkerframework.checker.calledmethods.builder.BuilderFrameworkSupportUtils Maven / Gradle / Ivy

Go to download

The Checker Framework enhances Java's type system to make it more powerful and useful. This lets software developers detect and prevent errors in their Java programs. The Checker Framework includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits you to write your own compiler plug-ins.

There is a newer version: 3.43.0
Show newest version
package org.checkerframework.checker.calledmethods.builder;

import javax.lang.model.type.TypeMirror;

/** A utility class of static methods used in supporting builder-generation frameworks. */
public class BuilderFrameworkSupportUtils {
  /** This class is non-instantiable. */
  private BuilderFrameworkSupportUtils() {
    throw new Error("Do not instantiate");
  }

  /**
   * Returns true if the given type is one of the immutable collections defined in
   * com.google.common.collect.
   *
   * @param type a type
   * @return true if the type is a Guava immutable collection
   */
  public static boolean isGuavaImmutableType(TypeMirror type) {
    return type.toString().startsWith("com.google.common.collect.Immutable");
  }

  /**
   * Capitalizes the first letter of the given string.
   *
   * @param prop a String
   * @return the same String, but with the first character capitalized
   */
  public static String capitalize(String prop) {
    return prop.substring(0, 1).toUpperCase() + prop.substring(1);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy