Class DefaultModulithMetadata

java.lang.Object
org.springframework.modulith.core.DefaultModulithMetadata
All Implemented Interfaces:
ModulithMetadata

class DefaultModulithMetadata extends Object implements ModulithMetadata
Creates a new ModulithMetadata representing the defaults of Modulithic but without the annotation present.
Author:
Oliver Drotbohm
  • Method Details

    • of

      public static Optional<ModulithMetadata> of(Class<?> annotated)
      Creates a new ModulithMetadata representing the defaults of a class annotated but not customized with Modulithic or Modulith.
      Parameters:
      annotated - must not be null.
      Returns:
    • of

      public static ModulithMetadata of(String javaPackage)
      Creates a new ModulithMetadata from the given package name.
      Parameters:
      javaPackage - must not be null or empty.
      Returns:
      will never be null.
    • getModulithSource

      public Object getModulithSource()
      Description copied from interface: ModulithMetadata
      Returns the source of the Spring Modulith setup. Either a type or a package.
      Specified by:
      getModulithSource in interface ModulithMetadata
      Returns:
      will never be null.
    • getSource

      public Object getSource()
      Description copied from interface: ModulithMetadata
      Returns the source of the Spring Modulith setup. Either a type or a package.
      Specified by:
      getSource in interface ModulithMetadata
      Returns:
      will never be null.
    • getAdditionalPackages

      public List<String> getAdditionalPackages()
      Description copied from interface: ModulithMetadata
      Returns the names of the packages that are supposed to be considered modulith base packages, i.e. for which to consider all direct sub-packages modules by default.
      Specified by:
      getAdditionalPackages in interface ModulithMetadata
      Returns:
      will never be null.
    • useFullyQualifiedModuleNames

      public boolean useFullyQualifiedModuleNames()
      Description copied from interface: ModulithMetadata
      Whether to use fully-qualified module names, i.e. rather use the fully-qualified package name instead of the local one.
      Specified by:
      useFullyQualifiedModuleNames in interface ModulithMetadata
      Returns:
    • getSharedModuleNames

      public Stream<String> getSharedModuleNames()
      Description copied from interface: ModulithMetadata
      Returns the name of shared modules, i.e. modules that are supposed to always be included in bootstraps.
      Specified by:
      getSharedModuleNames in interface ModulithMetadata
      Returns:
      will never be null.
    • getSystemName

      public Optional<String> getSystemName()
      Description copied from interface: ModulithMetadata
      Returns the name of the system.
      Specified by:
      getSystemName in interface ModulithMetadata
      Returns:
      will never be null.