
com.julienlavergne.core.configuration.Profile Maven / Gradle / Ivy
The newest version!
package com.julienlavergne.core.configuration;
import com.google.common.base.Objects;
import java.util.EnumSet;
/**
* Created with IntelliJ IDEA.
* com.julienlavergne.core.User: julien
* Date: 7/28/13
* Time: 19:20
* To change this template use File | Settings | File Templates.
*/
public enum Profile {
DEV("dev"),
PROD("prod"),
staging("staging"),
TEST("test"),
NONE("");
private final String fullName;
Profile(String fullName) {
this.fullName = fullName;
}
public static Profile getByFullName(String fullName) {
for (Profile profile : EnumSet.allOf(Profile.class)) {
String profileName = profile.getFullName().toUpperCase();
if (profileName.equals(fullName.toUpperCase())) {
return profile;
}
}
return null;
}
public String getFullName() {
return fullName;
}
@Override
public String toString() {
return Objects.toStringHelper(this)
.add("fullName", fullName)
.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy