conorH22/bike-rental

View on GitHub
src/main/java/com/csharp/bikerental/persistence/model/TwoWheel/TwoWheelFactory.java

Summary

Maintainability
A
0 mins
Test Coverage
package com.csharp.bikerental.persistence.model.TwoWheel;


import com.csharp.bikerental.persistence.model.TwoWheel.TwoWheel;

public abstract class TwoWheelFactory {


    public enum twoWheelType {
        BIKE, EBIKE, SCOOTER, ESCOOTER

    }

    public static TwoWheel CreateTwoWheelItems(twoWheelType twotype) {
        switch ( twotype) {
            case BIKE:
                return new Bike();
            case EBIKE:
                return new EBike();

            case SCOOTER:
                return new Scooter();

            case ESCOOTER:
                return new EScooter();
             default:
                 System.out.println("no bike type selected please try again");
                 break;
        }

        return null;
    }


}