Skip to content

Instantly share code, notes, and snippets.

@maneeshaindrachapa
Created February 18, 2022 09:33
Show Gist options
  • Save maneeshaindrachapa/64ad22989db443dc1996881cff5e5249 to your computer and use it in GitHub Desktop.
Save maneeshaindrachapa/64ad22989db443dc1996881cff5e5249 to your computer and use it in GitHub Desktop.
Region - Tour California Application
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