Package com.bddinaction.flyinghigh.services

Source Code of com.bddinaction.flyinghigh.services.InMemoryStatusService

package com.bddinaction.flyinghigh.services;

import com.bddinaction.flyinghigh.model.Status;

public class InMemoryStatusService implements StatusService {
    public Status statusLevelFor(int statusPoints) {
        Status highestMatchingStatus = Status.Bronze;
        for(Status status : Status.values())  {
            if (statusPoints >= status.getMinimumPoints()) {
                highestMatchingStatus = status;
            }
        }
        return highestMatchingStatus;
    }
}
TOP

Related Classes of com.bddinaction.flyinghigh.services.InMemoryStatusService

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.