Codota Logo
FieldDefinitionValidator.validate
Code IndexAdd Codota to your IDE (free)

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

Best Java code snippets using com.palantir.conjure.defs.validator.FieldDefinitionValidator.validate (Showing top 2 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

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.validatorFieldDefinitionValidatorvalidate

Popular methods of FieldDefinitionValidator

  • checkForComplexType

Popular in Java

  • Start an intent from android
  • getContentResolver (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URI (java.net)
    Represents a Uniform Resource Identifier (URI) reference. Aside from some minor deviations noted bel
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
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