Advertisement
Guest User

Untitled

a guest
Dec 6th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package com.wallapop.marsRover.business.valueObjects;
  2.  
  3. public class DirectionFactory {
  4.     public static Direction createDirection(Character character) {
  5.         switch (character) {
  6.             case 'n':
  7.                 return new NorthDirection();
  8.             case 'w':
  9.                 return new WestDirection();
  10.             case 'e':
  11.                 return new EastDirection();
  12.             default:
  13.                 return new SouthDirection();
  14.         }
  15.  
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement