Package com.google.inject.internal
Class DuplicateMapKeyError<K,V>
java.lang.Object
com.google.inject.spi.ErrorDetail<DuplicateMapKeyError<K,V>>
com.google.inject.internal.InternalErrorDetail<DuplicateMapKeyError<K,V>>
com.google.inject.internal.DuplicateMapKeyError<K,V>
- All Implemented Interfaces:
Serializable
Error reported by Guice when a duplicate key is found in a
that does not permit
duplicates.
invalid reference
MapBinder
-
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class com.google.inject.internal.InternalErrorDetail
errorId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidformatDetail(List<ErrorDetail<?>> others, Formatter formatter) Formats the detail of this error message along with other errors that are mergeable with this error.private static <K,V> String getDuplicateKeysMessage(Key<Map<K, V>> mapKey, com.google.common.collect.Multimap<K, Binding<V>> duplicates) 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
-
mapKey
-
duplicates
-
-
Constructor Details
-
DuplicateMapKeyError
-
-
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<DuplicateMapKeyError<K,V>> - Parameters:
others- 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<DuplicateMapKeyError<K,V>>
-
getDuplicateKeysMessage
-