/** * Get ResourceType from a raw resource value. * E.g. From "rovenance-data/processors/7ce897d6-0164-1000-fc87-caee3b08ba47", ProvenanceData will be returned. * @param rawValue the raw resource string representation * @return the type of the specified resource, or null if not found */ public static ResourceType fromRawValue(final String rawValue) throws IllegalArgumentException { for (final ResourceType rt : values()) { if (rt.getValue().equals(rawValue) || rawValue.startsWith(rt.getValue() + "/")) { return rt; } } return null; } }