Class FormattableType
java.lang.Object
org.springframework.modulith.core.FormattableType
Wrapper around
JavaClass that allows creating additional formatted names.- Author:
- Oliver Drotbohm
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumHow to handle types that are not contained in anApplicationModule. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringFormats the givenJavaClasses by rendering a comma-separated list with the abbreviated class names.Returns the abbreviated (i.e. every package fragment reduced to its first character) full name, e.g.getAbbreviatedFullName(@Nullable ApplicationModule module) Returns the abbreviated full name of the type abbreviating only the part of the givenApplicationModule's base package.getAbbreviatedFullName(@Nullable ApplicationModule module, FormattableType.NonModuleTypeAbbreviation abbreviation) Returns the abbreviated full name of the type abbreviating only the part of the givenApplicationModule's base package.Returns the type's full name.static FormattableTypeof(com.tngtech.archunit.core.domain.JavaClass type) Creates a newFormattableTypefor the givenJavaClass.static FormattableTypeCreates a newFormattableTypefor the givenClass.
-
Method Details
-
of
Creates a newFormattableTypefor the givenJavaClass.- Parameters:
type- must not be null.- Returns:
- will never be null.
-
of
Creates a newFormattableTypefor the givenClass.- Parameters:
type- must not be null.- Returns:
- will never be null.
-
format
Formats the givenJavaClasses by rendering a comma-separated list with the abbreviated class names.- Parameters:
types- must not be null.- Returns:
- will never be null.
-
getAbbreviatedFullName
Returns the abbreviated (i.e. every package fragment reduced to its first character) full name, e.g.com.acme.MyTypewill result inc.a.MyType.- Returns:
- will never be null.
-
getAbbreviatedFullName
Returns the abbreviated full name of the type abbreviating only the part of the givenApplicationModule's base package.- Parameters:
module- can be null.- Returns:
- will never be null.
-
getAbbreviatedFullName
public String getAbbreviatedFullName(@Nullable ApplicationModule module, FormattableType.NonModuleTypeAbbreviation abbreviation) Returns the abbreviated full name of the type abbreviating only the part of the givenApplicationModule's base package.- Parameters:
module- can be null.abbreviation- must not be null.- Returns:
- will never be null.
- Since:
- 2.1
-
getFullName
Returns the type's full name.- Returns:
- will never be null.
-