Make this MultiValue Immutable.

@return MultiValue
6961
public function immutable()
    {
        $this->isImmutable = true;

        // Lock nested items.
        foreach ($this->getArrayCopy() as $item) {
            if ($item instanceof MultiValue) {
                $item->immutable();
            }
        }
        return $this;
    }
580993
public static final function values() {
		$calledClass = get_called_class();

		// let's check the cache so we don't have to call reflection constantly
		if (empty(self::$cachedValues[$calledClass])) {
			$class = new \ReflectionClass($calledClass);
			self::$cachedValues[$calledClass] = $class->getConstants();
		}

		return self::$cachedValues[$calledClass];
	}
1217528
public function performReadonlyTransformation()
    {
        /** @var TreeMultiselectField_Readonly $copy */
        $copy = $this->castedCopy(TreeMultiselectField_Readonly::class);
        $copy->setKeyField($this->getKeyField());
        $copy->setLabelField($this->getLabelField());
        $copy->setSourceObject($this->getSourceObject());
        $copy->setTitleField($this->getTitleField());
        return $copy;
    }
725626
public function setImmutable($immutable = true)
    {
        if ($immutable) {
            $this->headers->addCacheControlDirective('immutable');
        } else {
            $this->headers->removeCacheControlDirective('immutable');
        }

        return $this;
    }
1234854
public function withoutDuplicates(): self
    {
        if (count($this->pairs) === count(array_count_values(array_column($this->pairs, 0)))) {
            return $this;
        }

        $pairs = array_reduce($this->pairs, [$this, 'removeDuplicates'], []);
        if ($pairs === $this->pairs) {
            return $this;
        }

        $clone = clone $this;
        $clone->pairs = $pairs;

        return $clone;
    }
79818
public function clearValues()
    {
        foreach ($this->fields as $name => $field) {
            $field->setValue(null);
        }

        return $this;
    }
919213
public function val() {
		if ($this->key instanceof ScalarValueInterface) {
			$key = $this->key->val();
		} else {
			$key = $this->key;
		}
		if ($this->array instanceof ArrayValueInterface) {
			$array = $this->array->val();
		} else {
			$array = $this->array;
		}
		
		if (isset($array[$key])) {
			return $array[$key];
		} else {
			if ($this->defaultValue instanceof ValueInterface) {
				return $this->defaultValue->val();
			} else {
				return $this->defaultValue;
			}
		}
	}
443124
public function copy()
    {
        $list = [];
        foreach ($this->getIterator() as $key => $value) {
            $list[$key] = \is_object($value) ? clone $value : $value;
        }

        return $this->createFrom($list);
    }
199597
public function swapChangedAttributes()
    {
        if (false === $this->originalAttributesLoaded) {

            $this->swappedAttributes = $this->getAttributes();
            $this->fill($this->getOriginal());

            $this->originalAttributesLoaded = true;

            return $this;
        }

        if  ( ! count($this->swappedAttributes)) {
            $this->swappedAttributes = $this->getAttributes();
        }

        $this->fill($this->swappedAttributes);

        $this->originalAttributesLoaded = false;

        return $this;
    }
665414
public function mul($value)
    {
        $this->requiresCurrentField();
        $this->newObj['$mul'][$this->currentField] = $value;
        return $this;
    }
541411
public function resetOneTimeValues()
    {
        $this->prefix = null;

        $this->suffix = null;

        $this->fakerString = null;

        return $this;
    }
533079
public <N1 extends N, V1 extends V> MutableValueGraph<N1, V1> build() {
    return new ConfigurableMutableValueGraph<N1, V1>(this);
  }
158215
@SuppressWarnings("unchecked") //
  public static <E> ImmutableMultiset<E> of(E e1, E e2) {
    return copyOfInternal(e1, e2);
  }
265231
public function toValue() {
    $ret = array();
    foreach ($this->elements->getItems() as $element) {
      if ($element instanceof ArrayNode) {
        $ref[] = $element->toValue();
      }
      elseif ($element instanceof ArrayPairNode) {
        $key = $element->getKey();
        $value = $element->getValue();
        $value_convertable = $value instanceof ScalarNode || $value instanceof ArrayNode;
        if (!($key instanceof ScalarNode && $value_convertable)) {
          throw new \BadMethodCallException('Can only convert scalar arrays.');
        }
        $ret[$key->toValue()] = $value->toValue();
      }
      elseif ($element instanceof ScalarNode || $element instanceof ArrayNode) {
        /** @var ScalarNode|ArrayNode $element */
        $ret[] = $element->toValue();
      }
      else {
        throw new \BadMethodCallException('Can only convert scalar arrays.');
      }
    }
    return $ret;
  }
162017
public static function values()
    {
        $values = array();
        foreach (static::toArray() as $key => $value) {
            $values[$key] = new static($value);
        }
        return $values;
    }
991129
public function buildValue()
    {
        $actions = [
            'add' => [],
            'replace' => [],
            'remove' => [],
        ];

        foreach ($this->actions as $action) {
            switch ($action->getName()) {
                case 'add':
                    $actions['add'][] = [$action->getArgument(0)];
                    break;
                case 'replace':
                    $actions['replace'][] = [$action->getArgument(0), $action->getArgument(1)];
                    break;
                case 'remove':
                    $actions['remove'][] = [$action->getArgument(0)];
                    break;
            }
        }

        $builder = $this->getBuilder();

        foreach ($actions as $action => $calls) {
            foreach ($calls as $arguments) {
                call_user_func_array([$builder, $action], $arguments);
            }
        }

        return $builder->get();
    }
1005678
public function getConvertedFromValue()
    {
        if ($this->valueHasBeenConverted === false) {
            $value = $this->executeValueConversion();

            $this->convertedFromValue = $value[0];
            $this->convertedToValue = $value[1];

            $this->valueHasBeenConverted = true;
        }

        return $this->convertedFromValue;
    }