Tabnine Logo
EnumDefinition$Builder
Code IndexAdd Tabnine to your IDE (free)

How to use
EnumDefinition$Builder
in
com.palantir.conjure.spec

Best Java code snippets using com.palantir.conjure.spec.EnumDefinition$Builder (Showing top 2 results out of 315)

origin: palantir/conjure

public static TypeDefinition parseEnumType(
    TypeName name,
    com.palantir.conjure.parser.types.complex.EnumTypeDefinition def) {
  EnumDefinition enumType = EnumDefinition.builder()
      .typeName(name)
      .values(def.values().stream().map(ConjureParserUtils::parseEnumValue).collect(Collectors.toList()))
      .docs(def.docs().map(Documentation::of))
      .build();
  EnumDefinitionValidator.validateAll(enumType);
  return TypeDefinition.enum_(enumType);
}
origin: palantir/conjure

  @Test
  public void testUniqueEnumValues() {
    EnumDefinition.Builder definition = EnumDefinition.builder()
        .typeName(TypeName.of("Foo", "package"))
        .values(EnumValueDefinition.builder().value("FOO").build())
        .values(EnumValueDefinition.builder().value("FOO").build());

    assertThatThrownBy(() -> EnumDefinitionValidator.validateAll(definition.build()))
        .isInstanceOf(IllegalArgumentException.class)
        .hasMessage("Cannot declare a EnumTypeDefinition with duplicate enum values: FOO");
  }
}
com.palantir.conjure.specEnumDefinition$Builder

Most used methods

  • build
  • typeName
  • values
  • docs

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • notifyDataSetChanged (ArrayAdapter)
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • 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