Git Product home page Git Product logo
public class JaeLim extends Developer implements Dad, Golfer, YardWorker, Pilot {

  /**
   * Gets my children from SUPER secret storage.
   * 
   * @return A list of my children.
   */
  private static List<Child> getMyChildren() {
    return Arrays.asList(new Child(), new Child());
  }

  /**
   * Gets a list of programming languages that a developer can use.
   * 
   * @return A list of programming languages. Max 5 languages.
   */
  @Override
  public List<Language> getAvailableProgrammingLanguages() {
    return Arrays.asList(Language.Java, Language.CSharp, Language.ObjectiveC, Language.C, Language.Ruby);
  }

  /**
   * Gets a pilot license which is currently valid.
   * 
   * @return The current pilot license.
   */
  @Override
  public License getLicense() {
    return License.PrivatePilot;
  }

  /**
   * Gets a list of acquired ratings.
   * 
   * @return A list of acquired ratings.
   */
  @Override
  public List<Rating> getRatings() {
    return new ArrayList<>() {
      {
        add(Rating.Instrument);
      }
    };
  }

  /**
   * Works hard.
   */
  @Override
  public void work() {

    // Re-factor this method to be comparable at home office.
    super.work();
  }

  /**
   * Plays with the given children.
   * 
   * @param children A list of children.
   * @throws Exception An exception can be thrown when a dad didn't expect the
   *                   current situation.
   * @see <code>DadCapacityExceededException</code>,
   *      <code>DeadlockException</code>
   */
  @Override
  public synchronized void play(@NonNull List<Child> children) throws Exception {

    // Validation
    if (children.size() > 2) {
      throw new DadCapacityExceededException();
    }

    // ...

    // Verify result
    if (children.stream().anyMatch(child -> !child.didEnjoy())) {
      throw new DeadlockException();
    }
  }

  public static void main(String[] args) throws Exception {
    JaeLim myself = new JaeLim();
    Date today = new Date();

    Scheduler.scheduleGolf(myself, Collections.singletonList(Day.Saturday));

    if (Season.getCurrentSeason(today) == Season.Summer) {
      Scheduler.scheduleYardWorker(myself, Collections.singletonList(Day.Sunday),
          Arrays.asList(Lawn.Backyard, Lawn.Frontyard, Lawn.Shrubs));
    }

    myself.work();
    myself.play(getMyChildren());
  }
}

Jae Lim's Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.