package lan.dk.podcastserver.entity;

import java.util.Arrays;

/**
 * Created by kevin on 18/02/15.
 */
public enum Status {
    NOT_DOWNLOADED("Not Downloaded"),
    DELETED("Deleted"),
    STARTED("Started"),
    FINISH("Finish"),
    STOPPED("Stopped"), 
    PAUSED("Paused");

    private final String name;

    private Status(String s) {
        name = s;
    }

    public boolean is(String otherName){
        return (otherName != null) && name.equals(otherName);
    }

    public String value() {
        return name;
    }
    
    public static Status byValue(String name) {
        return Arrays.stream(Status.values())
                .filter(status -> status.is(name))
                .findFirst()
                .get();
    }
    
}

@@ -311,24 +311,16 @@
 e;%0A%0A    
-private 
 Status(S

change visibility of Status constructor