Class RealMultibinder.PermitDuplicatesModule

  • All Implemented Interfaces:
    Module
    Enclosing class:
    RealMultibinder<T>

    private static class RealMultibinder.PermitDuplicatesModule
    extends AbstractModule
    We install the permit duplicates configuration as its own binding, all by itself. This way, if only one of a multibinder's users remember to call permitDuplicates(), they're still permitted.

    This is like setting a global variable in the injector so that each instance of the multibinder will have the same value for permitDuplicates, even if it is only set on one of them.

    • Field Detail

      • key

        private final Key<java.lang.Boolean> key
    • Constructor Detail

      • PermitDuplicatesModule

        PermitDuplicatesModule​(Key<java.lang.Boolean> key)
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object