import static java.util.Objects.requireNonNull;
import org.eclipse.jdt.annotation.NonNull;
-import org.eclipse.jdt.annotation.Nullable;
/**
* Enumeration of possible {@code content} values as defined by
return uriValue;
}
- // Note: returns null of unknowns
- public static @Nullable ContentParam forUriValue(final String uriValue) {
+ public static @NonNull ContentParam forUriValue(final String uriValue) {
switch (uriValue) {
case "all":
return ALL;
case "nonconfig":
return NONCONFIG;
default:
- return null;
+ throw new IllegalArgumentException(
+ "Value can be 'all', 'config' or 'nonconfig', not '" + uriValue + "'");
}
}
}