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

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

Best Java code snippets using com.palantir.conjure.defs.validator.ObjectDefinitionValidator.validate (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.validatorObjectDefinitionValidatorvalidate

Popular methods of ObjectDefinitionValidator

    Popular in Java

    • Making http requests using okhttp
    • onRequestPermissionsResult (Fragment)
    • addToBackStack (FragmentTransaction)
    • scheduleAtFixedRate (ScheduledExecutorService)
    • BorderLayout (java.awt)
      A border layout lays out a container, arranging and resizing its components to fit in five regions:
    • OutputStream (java.io)
      A writable sink for bytes.Most clients will use output streams that write data to the file system (
    • System (java.lang)
      Provides access to system-related information and resources including standard input and output. Ena
    • TimeZone (java.util)
      TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
    • Response (javax.ws.rs.core)
      Defines the contract between a returned instance and the runtime when an application needs to provid
    • StringUtils (org.apache.commons.lang)
      Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
    • Top plugins for WebStorm
    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