Tabnine Logo
TypeNameValidator
Code IndexAdd Tabnine to your IDE (free)

How to use
TypeNameValidator
in
com.palantir.conjure.defs.validator

Best Java code snippets using com.palantir.conjure.defs.validator.TypeNameValidator (Showing top 3 results out of 315)

origin: palantir/conjure

public static TypeName createTypeName(
    String name,
    com.palantir.conjure.parser.types.BaseObjectTypeDefinition def,
    Optional<String> defaultPackage) {
  TypeName type = TypeName.of(name, parsePackageOrElseThrow(def.conjurePackage(), defaultPackage));
  TypeNameValidator.validate(type);
  return type;
}
origin: palantir/conjure

@Test
public void testValidNames() {
  TypeNameValidator.validate(TypeName.of("Camel", PACKAGE));
  TypeNameValidator.validate(TypeName.of("CamelCase", PACKAGE));
  TypeNameValidator.validate(TypeName.of("CamelCase1", PACKAGE));
  TypeNameValidator.validate(TypeName.of("Camel1Case2", PACKAGE));
}
origin: palantir/conjure

  @Test
  public void testInvalidNames() {
    for (String invalid : new String[] {"a", "IFoo", "ABC", "$Special", "snake_case", "kebab-case", "Camel1B"}) {
      assertThatThrownBy(() -> TypeNameValidator.validate(TypeName.of(invalid, PACKAGE)))
          .isInstanceOf(IllegalArgumentException.class)
          .hasMessage("TypeNames must be a primitive type"
              + " [STRING, DATETIME, INTEGER, DOUBLE, SAFELONG, BINARY, ANY, BOOLEAN, UUID, RID,"
              + " BEARERTOKEN, UNKNOWN] or match pattern ^[A-Z][a-z0-9]+([A-Z][a-z0-9]+)*$: %s",
              invalid);
    }
  }
}
com.palantir.conjure.defs.validatorTypeNameValidator

Most used methods

  • validate

Popular in Java

  • Start an intent from android
  • compareTo (BigDecimal)
  • setContentView (Activity)
  • getApplicationContext (Context)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • List (java.util)
    An ordered collection (also known as a sequence). The user of this interface has precise control ove
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now