/java7to8

Yoda Replies Restfully sample declarative code!

Primary LanguageJavaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Java 7 -> 8: Yoda Replies Restfully

Simple yet complete coding challenge with Spring Framework

Content

Spring Boot project implemented on Java 8 using Gradle

  • Explicit vs. Implicit cycles
  • SAM interfaces & lambdas
  • Stream (and other functors & monads)
  • New date and time API

Sample end-points

Max 9 search results
  • ✓ GET /species?q={search}
  • ✓ GET /vehicles?q={search}
  • ✓ GET /planets?q={search}
  • ✓ GET /films?q={search}
Join & filter
  • ✓ GET /species/{species}/in/{planet} ...returns people of single species of planet
  • ✓ GET /films/{film}/starpilots ...returns a film's starship pilots (people) with hyperdrive_rating above 1
  • ✓ GET /vehicles/{vehicle}/lifespan ...returns the vehicle duration period between first and last films

Try out

Import the files (build.gradle as a project) in an IDE (like Eclipse or IntelliJ) or with VSCode adding the Java Extension Pack (also by the shell command code <project-folder>), execute via main method or JUnit Test files

Can also be deployed by shell command, in the project path use ./gradlew bootRun

Contributors