Package com.google.inject.internal
Class DuplicateElementError<T>
java.lang.Object
com.google.inject.spi.ErrorDetail<DuplicateElementError<T>>
com.google.inject.internal.InternalErrorDetail<DuplicateElementError<T>>
com.google.inject.internal.DuplicateElementError<T>
- All Implemented Interfaces:
Serializable
Error reported by Guice when duplicate elements are found in a
that does not
permit duplicates.
invalid reference
Multibinder
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final com.google.common.collect.ImmutableMultimap<T, DuplicateElementError.Element<T>> Fields inherited from class com.google.inject.internal.InternalErrorDetail
errorId -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateDuplicateElementError(Key<Set<T>> setKey, com.google.common.collect.ImmutableMultimap<T, DuplicateElementError.Element<T>> elements, List<Object> sources) (package private)DuplicateElementError(Key<Set<T>> setKey, List<Binding<T>> bindings, T[] values, List<Object> sources) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidformatDetail(List<ErrorDetail<?>> others, Formatter formatter) Formats the detail of this error message along with other errors that are mergeable with this error.private voidformatElement(DuplicateElementError.Element<T> element, Formatter formatter) (package private) static <T> com.google.common.collect.ImmutableMultimap<T, DuplicateElementError.Element<T>> indexElements(List<Binding<T>> bindings, T[] values) 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, isMergeable
-
Field Details
-
setKey
-
elements
private final com.google.common.collect.ImmutableMultimap<T,DuplicateElementError.Element<T>> elements
-
-
Constructor Details
-
DuplicateElementError
-
DuplicateElementError
-
-
Method Details
-
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<DuplicateElementError<T>>- Parameters:
others- list of errors that are mergeable with this errorformatter- for printing the error message
-
formatElement
-
withSources
Description copied from class:ErrorDetailReturns a new instance of the sameErrorDetailwith updated sources.- Specified by:
withSourcesin classErrorDetail<DuplicateElementError<T>>
-
indexElements
static <T> com.google.common.collect.ImmutableMultimap<T,DuplicateElementError.Element<T>> indexElements(List<Binding<T>> bindings, T[] values)
-