@SuppressWarnings("unchecked") @Override @Nonnull public HashObjShortMapFactory<K> withKeyEquivalence( @Nonnull Equivalence<? super K> keyEquivalence) { if (keyEquivalence.equals(Equivalence.defaultEquality())) return new WithCustomDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), defaultValue); if (keyEquivalence.equals(this.keyEquivalence)) { return (HashObjShortMapFactory<K>) this; } return new WithCustomKeyEquivalenceAndDefaultValue<K>( getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), (Equivalence<K>) keyEquivalence, defaultValue); }
@SuppressWarnings("unchecked") @Override @Nonnull public HashObjShortMapFactory<K> withKeyEquivalence( @Nonnull Equivalence<? super K> keyEquivalence) { if (keyEquivalence.equals(Equivalence.defaultEquality())) { return (HashObjShortMapFactory<K>) this; } return new WithCustomKeyEquivalenceAndDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), (Equivalence<K>) keyEquivalence, defaultValue); }
@SuppressWarnings("unchecked") @Override @Nonnull public HashObjShortMapFactory<K> withKeyEquivalence( @Nonnull Equivalence<? super K> keyEquivalence) { if (keyEquivalence.equals(Equivalence.defaultEquality())) return new WithCustomDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), defaultValue); if (keyEquivalence.equals(this.keyEquivalence)) { return (HashObjShortMapFactory<K>) this; } return new WithCustomKeyEquivalenceAndDefaultValue<K>( getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), (Equivalence<K>) keyEquivalence, defaultValue); }
@Override HashObjShortMapFactory<K> thisWith(HashConfig hashConf, int defaultExpectedSize, boolean isNullKeyAllowed ) { return new WithCustomDefaultValue<K>(hashConf, defaultExpectedSize, isNullKeyAllowed , defaultValue); }
@Override HashObjShortMapFactory<K> qHashLikeThisWith(HashConfig hashConf, int defaultExpectedSize, boolean isNullKeyAllowed ) { return new QHashSeparateKVObjShortMapFactoryImpl.WithCustomDefaultValue<K>( hashConf, defaultExpectedSize, isNullKeyAllowed , defaultValue); } @Override
@Override HashObjShortMapFactory<K> thisWith(HashConfig hashConf, int defaultExpectedSize, boolean isNullKeyAllowed ) { return new WithCustomDefaultValue<K>(hashConf, defaultExpectedSize, isNullKeyAllowed , defaultValue); }
@Override HashObjShortMapFactory<K> qHashLikeThisWith(HashConfig hashConf, int defaultExpectedSize, boolean isNullKeyAllowed ) { return new QHashSeparateKVObjShortMapFactoryImpl.WithCustomDefaultValue<K>( hashConf, defaultExpectedSize, isNullKeyAllowed , defaultValue); } @Override
@Override HashObjShortMapFactory<K> qHashLikeThisWith(HashConfig hashConf, int defaultExpectedSize, boolean isNullKeyAllowed ) { return new QHashSeparateKVObjShortMapFactoryImpl.WithCustomDefaultValue<K>( hashConf, defaultExpectedSize, isNullKeyAllowed , defaultValue); } @Override
@Override @Nonnull public HashObjShortMapFactory<K> withDefaultValue(short defaultValue) { if (defaultValue == (short) 0) return this; return new WithCustomDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), defaultValue); }
@Override HashObjShortMapFactory<K> qHashLikeThisWith(HashConfig hashConf, int defaultExpectedSize, boolean isNullKeyAllowed ) { return new QHashSeparateKVObjShortMapFactoryImpl.WithCustomDefaultValue<K>( hashConf, defaultExpectedSize, isNullKeyAllowed , defaultValue); } @Override
@Override @Nonnull public HashObjShortMapFactory<K> withDefaultValue(short defaultValue) { if (defaultValue == (short) 0) return new QHashSeparateKVObjShortMapFactoryImpl<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed()); if (defaultValue == this.defaultValue) return this; return new WithCustomDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), defaultValue); }
@SuppressWarnings("unchecked") @Override @Nonnull public HashObjShortMapFactory<K> withKeyEquivalence( @Nonnull Equivalence<? super K> keyEquivalence) { if (keyEquivalence.equals(Equivalence.defaultEquality())) { return (HashObjShortMapFactory<K>) this; } return new WithCustomKeyEquivalenceAndDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), (Equivalence<K>) keyEquivalence, defaultValue); }
@Override @Nonnull public HashObjShortMapFactory<K> withDefaultValue(short defaultValue) { if (defaultValue == (short) 0) return new QHashSeparateKVObjShortMapFactoryImpl<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed()); if (defaultValue == this.defaultValue) return this; return new WithCustomDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), defaultValue); }
@Override @Nonnull public HashObjShortMapFactory<K> withDefaultValue(short defaultValue) { if (defaultValue == (short) 0) return this; return new WithCustomDefaultValue<K>(getHashConfig(), getDefaultExpectedSize() , isNullKeyAllowed(), defaultValue); }