design pattern

Mojito builder

SDK Version: 

Last week, in spite of the winter the weather was very mild. The beams of the winter sun brought forward the memories of the summer: hot weather, girls in bikinis, mojitos! We have already gotten a promise for the first two in a certain form here in Helloandroid HQ (the heating system will be repaired, and we 'll have some women colleagues), but it is our task to make coctails.

  1. public class Mojito {
  2.         private final int mWhiteRum;    //cl
  3.         private final int mBrownSugar;  //spoun
  4.         private final int mLime;                //clove
  5.         private final int mMenta;               //piece
  6.         private final int mSoda;                //decilitre
  8.         public Mojito(int whiteRum, int brownSugar, int lime, int menta, int soda){
  9.                 mWhiteRum = whiteRum;
  10.                 mBrownSugar = brownSugar;
  11.                 mLime = lime;
  12.                 mMenta = menta;
  13.                 mSoda = soda;
  14.         }
  15. }

Syndicate content