35
35
*
36
36
* @author Oliver Drotbohm
37
37
*/
38
- @ SuppressWarnings ("deprecation" )
39
- public class FormattableType extends FormatableType {
38
+ public class FormattableType {
40
39
41
40
private static final Map <String , FormattableType > CACHE = new ConcurrentHashMap <>();
42
41
43
42
private final String type ;
44
43
private final Supplier <String > abbreviatedName ;
45
44
46
45
/**
47
- * Creates a new {@link FormatableType } for the given source {@link String} and lazily computed abbreviated name.
46
+ * Creates a new {@link FormattableType } for the given source {@link String} and lazily computed abbreviated name.
48
47
*
49
48
* @param type must not be {@literal null} or empty.
50
49
* @param abbreviatedName must not be {@literal null}.
@@ -59,7 +58,7 @@ private FormattableType(String type, Supplier<String> abbreviatedName) {
59
58
}
60
59
61
60
/**
62
- * Creates a new {@link FormatableType } for the given fully-qualified type name.
61
+ * Creates a new {@link FormattableType } for the given fully-qualified type name.
63
62
*
64
63
* @param type must not be {@literal null} or empty.
65
64
*/
@@ -81,7 +80,7 @@ private FormattableType(String type) {
81
80
}
82
81
83
82
/**
84
- * Creates a new {@link FormatableType } for the given {@link JavaClass}.
83
+ * Creates a new {@link FormattableType } for the given {@link JavaClass}.
85
84
*
86
85
* @param type must not be {@literal null}.
87
86
* @return will never be {@literal null}.
@@ -94,7 +93,7 @@ public static FormattableType of(JavaClass type) {
94
93
}
95
94
96
95
/**
97
- * Creates a new {@link FormatableType } for the given {@link Class}.
96
+ * Creates a new {@link FormattableType } for the given {@link Class}.
98
97
*
99
98
* @param type must not be {@literal null}.
100
99
* @return will never be {@literal null}.
@@ -119,20 +118,23 @@ public static String format(Iterable<JavaClass> types) {
119
118
.collect (Collectors .joining (", " ));
120
119
}
121
120
122
- /*
123
- * (non-Javadoc)
124
- * @see org.springframework.modulith.core.FormatableType#getAbbreviatedFullName()
121
+ /**
122
+ * Returns the abbreviated (i.e. every package fragment reduced to its first character) full name, e.g.
123
+ * {@code com.acme.MyType} will result in {@code c.a.MyType}.
124
+ *
125
+ * @return will never be {@literal null}.
125
126
*/
126
- @ Override
127
127
public String getAbbreviatedFullName () {
128
128
return abbreviatedName .get ();
129
129
}
130
130
131
- /*
132
- * (non-Javadoc)
133
- * @see org.springframework.modulith.core.FormatableType#getAbbreviatedFullName(org.springframework.modulith.core.ApplicationModule)
131
+ /**
132
+ * Returns the abbreviated full name of the type abbreviating only the part of the given {@link ApplicationModule}'s
133
+ * base package.
134
+ *
135
+ * @param module can be {@literal null}.
136
+ * @return will never be {@literal null}.
134
137
*/
135
- @ Override
136
138
public String getAbbreviatedFullName (@ Nullable ApplicationModule module ) {
137
139
138
140
if (module == null ) {
@@ -161,11 +163,11 @@ public String getAbbreviatedFullName(@Nullable ApplicationModule module) {
161
163
.concat (ClassUtils .getShortName (type ));
162
164
}
163
165
164
- /*
165
- * (non-Javadoc)
166
- * @see org.springframework.modulith.core.FormatableType#getFullName()
166
+ /**
167
+ * Returns the type's full name.
168
+ *
169
+ * @return will never be {@literal null}.
167
170
*/
168
- @ Override
169
171
public String getFullName () {
170
172
return type .replace ("$" , "." );
171
173
}
0 commit comments