Created
February 18, 2022 09:33
-
-
Save maneeshaindrachapa/64ad22989db443dc1996881cff5e5249 to your computer and use it in GitHub Desktop.
Region - Tour California Application
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.explore.california.model; | |
public enum Region { | |
Central_Coast("Central Coast"), Southern_California("Southern California"), Northern_California( | |
"Northern California"), Varies("Varies"); | |
private String label; | |
private Region(String label) { | |
this.label = label; | |
} | |
public static Region findByLabel(String byLabel) { | |
for (Region r : Region.values()) { | |
if (r.label.equalsIgnoreCase(byLabel)) | |
return r; | |
} | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment