cleanup (inspection "Java | Class structure | Utility class is not 'final'")
[idea/community.git] / platform / analysis-impl / src / com / intellij / application / options / colors / ScopeAttributesUtil.java
1 // Copyright 2000-2020 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.
2 package com.intellij.application.options.colors;
3
4 import com.intellij.openapi.editor.colors.TextAttributesKey;
5 import com.intellij.util.containers.ConcurrentFactoryMap;
6 import org.jetbrains.annotations.NotNull;
7
8 import java.util.concurrent.ConcurrentMap;
9
10 public final class ScopeAttributesUtil {
11   private static final ConcurrentMap<String, TextAttributesKey> ourCache =
12     ConcurrentFactoryMap.createMap(scope -> TextAttributesKey.find("SCOPE_KEY_" + scope));
13   @NotNull
14   public static TextAttributesKey getScopeTextAttributeKey(@NotNull String scope) {
15     return ourCache.get(scope);
16   }
17 }