Semantic Wrapper

Use your own classes to provide semantics for the reader of your API or code. No Primitives generates them for you.

Get Semantic Wrapper

  1. Generate a configuration file src/main/semantic-wrapper/any-nameand tell No Primitives about your classes and their base types.
    com.github.stefanbirkner.noprimitives.example.OrderNumber : int
    com.github.stefanbirkner.noprimitives.example.Name : String
  2. Add the plugin to your POM
    <plugins>
      <plugin>
        <groupId>com.github.stefanbirkner</groupId>
        <artifactId>no-primitives-plugin</artifactId>
        <version>1.0.0</version>
      </plugin>
    </plugins>
  3. Generate your classes
    mvn generate-sources
  4. Use your classes by calling the constructor
    OrderNumber orderNumber = new OrderNumber(123);
    or the fluent interface
    Name name = name("Stefan");
    Name name = name(null); //name == null

Stefan Birkner (mail@stefan-birkner.de)