Interface ServiceContracts.FactoryAnalysis

Enclosing class:
ServiceContracts

public static interface ServiceContracts.FactoryAnalysis
Result of analysis of provided contracts.
  • Method Details

    • create

      Create a new result for cases where the service does not implement the factory interface.
      Returns:
      a new factory analysis that is not valid()
    • create

      static ServiceContracts.FactoryAnalysis create(TypeName factoryType, TypeName providedType, TypeInfo providedTypeInfo, Set<ResolvedType> providedContracts)
      The requested factory interface is implemented and provides one or more contracts.
      Parameters:
      factoryType - type of the factory implementation (such as Supplier<String>)
      providedType - the type provided (always a contract)
      providedTypeInfo - type info of the provided type
      providedContracts - transitive contracts (includes the provided type as well)
      Returns:
      a new analysis result for a valid factory implementation
    • valid

      boolean valid()
      whether the factory interface is implemented.
      Returns:
      if the factory interface is implemented by the service
    • factoryType

      TypeName factoryType()
      Type of the factory interface with type arguments (such as Supplier×String>, guard access by valid()).
      Returns:
      factory type name
    • providedType

      TypeName providedType()
      The contract provided (guard access by valid()).
      Returns:
      provided type name
    • providedTypeInfo

      TypeInfo providedTypeInfo()
      Type info of the provided type.
      Returns:
      type info of the providedType()
    • providedContracts

      Set<ResolvedType> providedContracts()
      All contracts transitively inherited from the provided type (guard access by valid()).
      Returns:
      provided contracts