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

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

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

origin: palantir/conjure

public static void validate(FieldDefinition definition) {
  checkForComplexType(definition);
}
origin: palantir/conjure

static List<FieldDefinition> parseField(
    Map<com.palantir.conjure.parser.types.names.FieldName,
        com.palantir.conjure.parser.types.complex.FieldDefinition> def,
    ConjureTypeParserVisitor.ReferenceTypeResolver typeResolver) {
  return def.entrySet().stream().map(entry -> {
    FieldDefinition fieldDefinition = FieldDefinition.builder()
        .fieldName(parseFieldName(entry.getKey()))
        .type(entry.getValue().type().visit(new ConjureTypeParserVisitor(typeResolver)))
        .docs(entry.getValue().docs().map(Documentation::of)).build();
    FieldDefinitionValidator.validate(fieldDefinition);
    return fieldDefinition;
  }).collect(Collectors.toList());
}
origin: palantir/conjure

  @Test
  public void testNoComplexKeysInMaps() {
    String illegalFieldName = "asdf";
    Type complexKeyType = Type.list(ListType.of(Type.primitive(PrimitiveType.STRING)));
    FieldDefinition fieldDefinition = FieldDefinition.of(
        FieldName.of(illegalFieldName),
        Type.map(MapType.of(complexKeyType, Type.primitive(PrimitiveType.STRING))),
        Documentation.of("docs"));
    assertThatThrownBy(() -> FieldDefinitionValidator.validate(fieldDefinition))
        .isInstanceOf(IllegalStateException.class)
        .hasMessageContaining(illegalFieldName)
        .hasMessageContaining(complexKeyType.toString());
  }
}
com.palantir.conjure.defs.validatorFieldDefinitionValidator

Most used methods

  • validate
  • checkForComplexType

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Collection (java.util)
    Collection is the root of the collection hierarchy. It defines operations on data collections and t
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Best plugins for Eclipse
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