public virtual ESAbstractAssociation <KeyType, ValueType> withKeyAndValue(KeyType newKey, ValueType newValue) { ESAbstractAssociation <KeyType, ValueType> mutableCopy = (ESAbstractAssociation <KeyType, ValueType>)base.shallowCopy(); mutableCopy.setKeyAndValue(newKey, newValue); if (IsImmutable) { mutableCopy.beImmutable(); } else if (IsKeyImmutable) { mutableCopy.keyBeImmutable(); } return(mutableCopy); }
public ESAbstractAssociation <KeyType, ValueType> withKey(KeyType newKey) { ESAbstractAssociation <KeyType, ValueType> mutableCopy = (ESAbstractAssociation <KeyType, ValueType>)base.shallowCopy(); mutableCopy.Key = newKey; if (IsImmutable) { mutableCopy.beImmutable(); } else if (IsKeyImmutable) { mutableCopy.keyBeImmutable(); } return(mutableCopy); }