Back to project page lifesaver.
The source code is released under:
Copyright (c) 2013 Nitin Dhar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Softwar...
If you think the Android project lifesaver listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.nitindhar.lifesaver.model; //from w w w. ja va 2 s . c om import com.google.common.base.Optional; public enum Subway { TRAIN_7("7"), TRAIN_N("N"), TRAIN_Q("Q"); private final String code; private Subway(String code) { this.code = code; } public String getCode() { return code; } public static Optional<Subway> fromString(String code) { for(Subway subway : values()) { if(subway.getCode().equals(code)) { return Optional.fromNullable(subway); } } return Optional.absent(); } @Override public String toString() { return getCode(); } }