Skip to content

Instantly share code, notes, and snippets.

View zjx-immersion's full-sized avatar

钟健鑫(Jason) zjx-immersion

  • ThoughtWorks
  • Chengdu,China
View GitHub Profile
@zjx-immersion
zjx-immersion / BuilderExample.java
Created May 11, 2018 11:47
Clean Code Examples
public class BuilderMain {
public static void main(String[] args) {
//Pattern
Product product = ProductBuilder()
.setId(39)
.setPrice(new PriceFactory().usingAmount(59).usingUnit(Unit.Dollar))
.setTitle("Product 1"),
.setDescription("Description goes here")
.getResult()