This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Maven template | |
| target/ | |
| ### JetBrains template | |
| *.iml | |
| .idea/ | |
| ### Compiled source | |
| *.class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class CalzonePizza extends Pizza { | |
| private final boolean sauceInside; | |
| private CalzonePizza(Builder builder) { | |
| super(builder); | |
| sauceInside = builder.sauceInside; | |
| } | |
| public static class Builder extends Pizza.Builder<Builder> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class NewYorkStylePizza extends Pizza { | |
| private final Size size; | |
| NewYorkStylePizza(Builder builder) { | |
| super(builder); | |
| size = builder.size; | |
| } | |
| public static class Builder extends Pizza.Builder<Builder> { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class Pizza { | |
| final Set<Topping> toppings; | |
| Pizza(Builder<?> builder) { | |
| toppings = builder.toppings.clone(); | |
| } | |
| abstract static class Builder<T extends Builder<T>> { | |
| EnumSet<Topping> toppings = EnumSet.noneOf(Topping.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # install required dependencies | |
| sudo apt-get update | |
| sudo apt-get install libtool e2fsprogs autoconf automake uuid-dev | |
| # get zeromq as tarball/zip | |
| wget http://download.zeromq.org/zeromq-4.1.3.tar.gz | |
| # unpack tarball file | |
| tar xvzf zeromq-4.1.3.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def food_fact_builder(servingSize, netWeight, packType, calories=0, sodium=0, carbohydrate=0): | |
| pineapple_jam = food_fact(servingSize, netWeight, packType, carbohydrate, calories, sodium) | |
| return pineapple_jam |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FoodFactBuilder { | |
| private final int servingSize; | |
| private final int netWeight; | |
| private final String packType; | |
| private final int calories; | |
| private final int sodium; | |
| private final int carbohydrate; | |
| public static class Builder { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FoodFacts { | |
| private int servingSize = -1; | |
| private int netWeight = -1; | |
| private String packType = ""; | |
| private int calories; | |
| private int sodium; | |
| private int carbohydrate; | |
| public FoodFacts() {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class FoodFacts { | |
| private final int servingSize; | |
| private final int netWeight; | |
| private final String packType; | |
| private int calories; | |
| private int sodium; | |
| private int carbohydrate; | |
| public FoodFacts(int servingSize, int netWeight, String packType) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package hello; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.ui.Model; | |
| import org.springframework.web.bind.annotation.GetMapping; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import org.springframework.web.bind.annotation.RestController; | |
| @RestController | |
| public class HelloController { |
NewerOlder