com.intellij.util.fmap.EmptyFMap Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of symbol-processing-aa Show documentation
Show all versions of symbol-processing-aa Show documentation
KSP implementation on Kotlin Analysis API
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.util.fmap;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
final class EmptyFMap<@NotNull K, @NotNull V> implements FMap {
static final EmptyFMap INSTANCE = new EmptyFMap<>();
@Override
public @NotNull FMap plus(K key, V value) {
return new OneKeyFMap<>(key, value);
}
@Override
public @NotNull FMap minus(K key) {
return this;
}
@Override
public @Nullable V get(K key) {
return null;
}
@Override
public boolean isEmpty() {
return true;
}
@Override
public int size() {
return 0;
}
@Override
public @NotNull Collection keys() {
return Collections.emptySet();
}
@Override
public @NotNull Map toMap() {
return Collections.emptyMap();
}
@Override
public String toString() {
return "[:]";
}
}