Design

wvlet.airframe.Design
See theDesign companion object
class Design(val designOptions: DesignOptions, val binding: Vector[Binding], val hooks: Vector[LifeCycleHookDesign]) extends LogSupport

Immutable airframe design.

Design instance does not hold any duplicate bindings for the same Surface.

Attributes

Companion:
object
Graph
Supertypes
trait LogSupport
trait LazyLogger
trait LoggingMethods
trait Serializable
class Object
trait Matchable
class Any
Known subtypes

Members list

Concise view

Value members

Concrete methods

def +(other: Design): Design
def add(other: Design): Design
def bind(t: Surface)(implicit sourceCode: SourceCode): Binder[Any]
def canEqual(other: Any): Boolean
override def equals(other: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Attributes

that

the object to compare against this object for equality.

Returns:

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Any
override def hashCode(): Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns:

the hash code value for this object.

Definition Classes
Any

Generates a minimized design by removing overwritten bindings

Generates a minimized design by removing overwritten bindings

Attributes

Create a new session.

Create a new session.

With this method, the session will not start automatically. You need to explicitly call session.start and session.shutdown to start/terminate the lifecycle of objects

Attributes

Method for configuring the session in details

Method for configuring the session in details

Attributes

def remove(t: Surface): Design

Used for casting itself as Design if returning DesignWithContext type is cumbersome

Used for casting itself as Design if returning DesignWithContext type is cumbersome

Attributes

override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns:

a string representation of the object.

Definition Classes
Any

Do not initialize singletons for debugging

Do not initialize singletons for debugging

Attributes

Enable eager initialization of singletons services for production mode

Enable eager initialization of singletons services for production mode

Attributes

def withSession[U](body: Session => U): U

Run the code block with a new session.

Run the code block with a new session.

This method will create a new session, start it, run the given code block, and finally terminate the session after the code block completion.

Attributes

def withStats(stats: DIStats): Design

Use a custom binding tracer

Use a custom binding tracer

Attributes

Inherited methods

inline def bind[A]: Binder[A]

Attributes

Inherited from:
DesignImpl (hidden)
inline def build[A](body: A => Any): Any

A helper method of creating a new session and an instance of A. This method is useful when you only need to use A as an entry point of your program. After executing the body, the sesion will be closed.

A helper method of creating a new session and an instance of A. This method is useful when you only need to use A as an entry point of your program. After executing the body, the sesion will be closed.

Attributes

Inherited from:
DesignImpl (hidden)
inline protected def debug(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def debug(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def error(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def info(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def logAt(inline logLevel: LogLevel, inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline def remove[A]: Design

Attributes

Inherited from:
DesignImpl (hidden)
inline def run[A, B](body: A => B): B

Execute a given code block by building A using this design, and return B

Execute a given code block by building A using this design, and return B

Attributes

Inherited from:
DesignImpl (hidden)
inline protected def trace(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def trace(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any, inline cause: Throwable): Unit

Attributes

Inherited from:
LoggingMethods
inline protected def warn(inline message: Any): Unit

Attributes

Inherited from:
LoggingMethods