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

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

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

origin: palantir/conjure

public static TypeDefinition parseObjectType(
    TypeName name,
    com.palantir.conjure.parser.types.complex.ObjectTypeDefinition def,
    ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
  ObjectDefinition objectType = ObjectDefinition.builder()
      .typeName(name)
      .fields(parseField(def.fields(), typeResolver))
      .docs(def.docs().map(Documentation::of))
      .build();
  ObjectDefinitionValidator.validate(objectType);
  return TypeDefinition.object(objectType);
}
origin: palantir/conjure

  private void testUniqueFieldNameValidator(String fieldName1, String fieldName2) {
    FieldDefinition field1 = FieldDefinition.builder()
        .fieldName(FieldName.of(fieldName1))
        .type(Type.primitive(PrimitiveType.STRING))
        .build();
    FieldDefinition field2 = FieldDefinition.builder()
        .fieldName(FieldName.of(fieldName2))
        .type(Type.primitive(PrimitiveType.STRING))
        .build();
    TypeName name = TypeName.of("Foo", "package");
    ObjectDefinition definition = ObjectDefinition.builder()
        .typeName(name)
        .fields(field1)
        .fields(field2)
        .build();

    assertThatThrownBy(() -> ObjectDefinitionValidator.validate(definition))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage(String.format("ObjectDefinition must not contain duplicate field names "
            + "(modulo case normalization): %s vs %s", fieldName2, fieldName1));
  }
}
com.palantir.conjure.defs.validatorObjectDefinitionValidator

Most used methods

  • validate

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • onCreateOptionsMenu (Activity)
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • JFrame (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Join (org.hibernate.mapping)
  • Top PhpStorm 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