Class or interface names should not shadow other classes or interfaces. In general, shadowing is a bad practice as it makes code harder to understand. Consider renaming this class.
Loading history...
8
9
private FieldFormatterType formatterType;
10
11
public FieldFormatter(FieldFormatterType type) {
12
formatterType = type;
13
}
14
15
public FieldFormatter(String type) {
16
this(FieldFormatterType.fromString(type));
17
}
18
19
public String format(String name) {
20
if (name.contains(" "))
21
throw new IllegalArgumentException("A field cannot have empty spaces.");
22
23
if (formatterType == FieldFormatterType.INHERITED)