/** * Lookup Presence name and return enum. * * @param name of presence to get * @return the {@link Presence} matching the name * @throws IllegalArgumentException if the name is not found */ public static Presence get(final String name) { for (final Presence p : values()) { if (p.value.equals(name)) { return p; } } throw new IllegalArgumentException("No Presence for name: " + name); } }
/** * Lookup Presence name and return enum. * * @param name of presence to get * @return the {@link Presence} matching the name * @throws IllegalArgumentException if the name is not found */ public static Presence get(final String name) { for (final Presence p : values()) { if (p.value.equals(name)) { return p; } } throw new IllegalArgumentException("No Presence for name: " + name); } }
/** * Lookup Presence name and return enum. * * @param name of presence to get * @return the {@link Presence} matching the name * @throws IllegalArgumentException if the name is not found */ public static Presence get(final String name) { for (final Presence p : values()) { if (p.value.equals(name)) { return p; } } throw new IllegalArgumentException("No Presence for name: " + name); } }
/** * Lookup Presence name and return enum. * * @param name of presence to get * @return the {@link Presence} matching the name * @throws IllegalArgumentException if the name is not found */ public static Presence get(final String name) { for (final Presence p : values()) { if (name.equals(p.value)) { return p; } } throw new IllegalArgumentException("No Presence for name: " + name); } }