Top Description Inners Fields Constructors Methods
com.google.inject.internal

pack-priv final Class DuplicateElementError<T>

extends InternalErrorDetail<DuplicateElementError<T>>
Class Inheritance
Imports
com.google.common.collect.ImmutableMultimap, com.google.inject.Binding, .Key, com.google.inject.spi.Dependency, .ErrorDetail, java.util.Collection, .Formatter, .List, .Map, .Set, java.util.stream.Collectors

Error reported by Guice when duplicate elements are found in a Multibinder that does not permit duplicates.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class

Field Summary

Modifier and TypeField and Description
private final ImmutableMultimap<T, DuplicateElementError.Element<T>>
private final Key<Set<T>>
Inherited from com.google.inject.internal.InternalErrorDetail:
errorId

Constructor Summary

AccessConstructor and Description
pack-priv
DuplicateElementError(Key<Set<T>> setKey, List<Binding<T>> bindings, T[] values, List<Object> sources)

private

Method Summary

Modifier and TypeMethod and Description
protected void
formatDetail(List<ErrorDetail<?>>
list of errors that are mergeable with this error
others
,
Formatter
for printing the error message
formatter
)

Implements abstract com.google.inject.spi.ErrorDetail.formatDetail.

Formats the detail of this error message along with other errors that are mergeable with this error.
private void
pack-priv static <T> ImmutableMultimap<T, DuplicateElementError.Element<T>>
indexElements(List<Binding<T>> bindings, T[] values)

public DuplicateElementError<T>
withSources(List<Object> newSources)

Implements abstract com.google.inject.spi.ErrorDetail.withSources.

Returns a new instance of the same ErrorDetail with updated sources.
Inherited from com.google.inject.internal.InternalErrorDetail:
getErrorIdentifiergetLearnMoreLink

Field Detail

elementsback to summary
private final ImmutableMultimap<T, DuplicateElementError.Element<T>> elements
setKeyback to summary
private final Key<Set<T>> setKey

Constructor Detail

DuplicateElementErrorback to summary
pack-priv DuplicateElementError(Key<Set<T>> setKey, List<Binding<T>> bindings, T[] values, List<Object> sources)
DuplicateElementErrorback to summary
private DuplicateElementError(Key<Set<T>> setKey, ImmutableMultimap<T, DuplicateElementError.Element<T>> elements, List<Object> sources)

Method Detail

formatDetailback to summary
protected void formatDetail(List<ErrorDetail<?>> others, Formatter formatter)

Implements abstract com.google.inject.spi.ErrorDetail.formatDetail.

Doc from com.google.inject.spi.ErrorDetail.formatDetail.

Formats the detail of this error message along with other errors that are mergeable with this error. This is called from format.

mergeableErrors is 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 calling isMergeable. The list will be empty if non of the other errors are mergable with this error.

Parameters
others:List<ErrorDetail<?>>

list of errors that are mergeable with this error

formatter:Formatter

for printing the error message

Annotations
@Override
formatElementback to summary
private void formatElement(DuplicateElementError.Element<T> element, Formatter formatter)
indexElementsback to summary
pack-priv static <T> ImmutableMultimap<T, DuplicateElementError.Element<T>> indexElements(List<Binding<T>> bindings, T[] values)
withSourcesback to summary
public DuplicateElementError<T> withSources(List<Object> newSources)

Implements abstract com.google.inject.spi.ErrorDetail.withSources.

Doc from com.google.inject.spi.ErrorDetail.withSources.

Returns a new instance of the same ErrorDetail with updated sources.

Annotations
@Override
com.google.inject.internal back to summary

pack-priv Class DuplicateElementError.Element<T>

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
pack-priv Binding<T>
pack-priv T

Constructor Summary

AccessConstructor and Description
pack-priv
Element(T value, Binding<T> binding)

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bindingback to summary
pack-priv Binding<T> binding
valueback to summary
pack-priv T value

Constructor Detail

Elementback to summary
pack-priv Element(T value, Binding<T> binding)