Package com.google.inject.internal
Class BindingAlreadySetError
java.lang.Object
com.google.inject.spi.ErrorDetail<BindingAlreadySetError>
com.google.inject.internal.InternalErrorDetail<BindingAlreadySetError>
com.google.inject.internal.BindingAlreadySetError
- All Implemented Interfaces:
Serializable
Error reported by Guice when a key is bound at multiple places the injector.
-
Field Summary
FieldsFields inherited from class com.google.inject.internal.InternalErrorDetail
errorId -
Constructor Summary
ConstructorsConstructorDescriptionBindingAlreadySetError(Binding<?> binding, Binding<?> original, List<Object> sources) -
Method Summary
Modifier and TypeMethodDescriptionvoidformatDetail(List<ErrorDetail<?>> mergeableErrors, Formatter formatter) Formats the detail of this error message along with other errors that are mergeable with this error.booleanisMergeable(ErrorDetail<?> otherError) Returns true if this error can be merged with theotherErrorand formatted together.withSources(List<Object> newSources) Returns a new instance of the sameErrorDetailwith updated sources.Methods inherited from class com.google.inject.internal.InternalErrorDetail
getErrorIdentifier, getLearnMoreLinkMethods inherited from class com.google.inject.spi.ErrorDetail
equals, format, getCause, getMessage, getSources, hashCode
-
Field Details
-
binding
-
original
-
-
Constructor Details
-
BindingAlreadySetError
-
-
Method Details
-
isMergeable
Description copied from class:ErrorDetailReturns true if this error can be merged with theotherErrorand formatted together.By default this return false and implementations that support merging with other errors should override this method.
- Overrides:
isMergeablein classErrorDetail<BindingAlreadySetError>
-
formatDetail
Description copied from class:ErrorDetailFormats the detail of this error message along with other errors that are mergeable with this error. This is called fromErrorDetail.format(int, java.util.List<com.google.inject.spi.ErrorDetail<?>>, java.util.Formatter).mergeableErrorsis a list that contains all other errors that are reported in the same exception that are considered to be mergable with this error base on result of callingErrorDetail.isMergeable(com.google.inject.spi.ErrorDetail<?>). The list will be empty if non of the other errors are mergable with this error.- Specified by:
formatDetailin classErrorDetail<BindingAlreadySetError>- Parameters:
mergeableErrors- list of errors that are mergeable with this errorformatter- for printing the error message
-
withSources
Description copied from class:ErrorDetailReturns a new instance of the sameErrorDetailwith updated sources.- Specified by:
withSourcesin classErrorDetail<BindingAlreadySetError>
-