Codota Logo
FieldDefinitionValidator
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
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

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • MessageFormat (java.text)
    MessageFormat provides a means to produce concatenated messages in language-neutral way. Use this to
  • List (java.util)
    A List is a collection which maintains an ordering for its elements. Every element in the List has a
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now