blob: 0c2951699bd07ba2eee3e0a6b58053b01f601f73 [file] [log] [blame]
// Copyright (c) 2013 VMware, Inc. All Rights Reserved.
// Copyright (C) 2017 The Android Open Source Project
//
// 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.googlesource.gerrit.owners.common;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import java.util.Map;
import java.util.Set;
/**
* OWNERS file model.
*
* <p>Used for de-serializing the OWNERS files.
*/
public class OwnersConfig {
/** Flag for marking that this OWNERS file inherits from the parent OWNERS. */
private boolean inherited = true;
/** Set of OWNER email addresses. */
private Set<String> owners = Sets.newHashSet();
/** Map name of matcher and Matcher (value + Set Owners) */
private Map<String, Matcher> matchers = Maps.newHashMap();
@Override
public String toString() {
return "OwnersConfig [inherited="
+ inherited
+ ", owners="
+ owners
+ ", matchers="
+ matchers
+ "]";
}
public boolean isInherited() {
return inherited;
}
public void setInherited(boolean inherited) {
this.inherited = inherited;
}
public Set<String> getOwners() {
return owners;
}
public void setOwners(Set<String> owners) {
this.owners = owners;
}
public Map<String, Matcher> getMatchers() {
return matchers;
}
public Matcher addMatcher(Matcher matcher) {
return this.matchers.put(matcher.path, matcher);
}
}