blob: 36edb24a810b126cd4deb0e44862d3b80c423025 [file] [log] [blame]
/*
* Copyright 2016 The Bazel Authors. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.google.idea.blaze.base.ideinfo;
import com.google.common.collect.ImmutableCollection;
import com.google.common.collect.ImmutableMap;
import java.io.Serializable;
/** Map of configured targets (and soon aspects). */
public class TargetMap implements Serializable {
private static final long serialVersionUID = 2L;
private final ImmutableMap<TargetKey, TargetIdeInfo> targetMap;
public TargetMap(ImmutableMap<TargetKey, TargetIdeInfo> targetMap) {
this.targetMap = targetMap;
}
public TargetIdeInfo get(TargetKey key) {
return targetMap.get(key);
}
public boolean contains(TargetKey key) {
return targetMap.containsKey(key);
}
public ImmutableCollection<TargetIdeInfo> targets() {
return targetMap.values();
}
public ImmutableMap<TargetKey, TargetIdeInfo> map() {
return targetMap;
}
}