// Path: src/main/java/nl/tudelft/ewi/gitolite/objects/Identifiable.java
// public interface Identifiable extends Comparable<Identifiable>, Serializable {
// 
// 	String getPattern();
// 
// 	@Override
// 	default int compareTo(Identifiable o) {
// 		return getPattern().compareTo(o.getPattern());
// 	}
// 
// }
// 
// Path: src/main/java/nl/tudelft/ewi/gitolite/objects/Identifier.java
// @Value
// public class Identifier implements Identifiable {
// 
// 	/**
// 	 * The name for the identifier
// 	 */
// 	private final String pattern;
// 
// 	private final static WeakHashMap<String, WeakReference<Identifier>> identifiableMap = new WeakHashMap<>();
// 
// 	/**
// 	 * Get an identifier. As {@code Identifiers} should be immutable, they are stored in a
// 	 * {@code WeakHashMap} for caching purposes. This method tries to find {@code Identifiers}
// 	 * in the cache first, and only creates a new instance if not. Therefore, this method is
// 	 * preferred over using a constructor.
// 	 *
// 	 * @param name Name for the identifier.
// 	 * @return Identifier
// 	 */
// 	public static Identifier valueOf(String name) {
// 		WeakReference<Identifier> ref = identifiableMap.get(name);
// 		Identifier identifiable;
// 		if(ref == null || (identifiable = ref.get()) == null) {
// 			identifiable = new Identifier(name);
// 			identifiableMap.put(name, new WeakReference<>(identifiable));
// 		}
// 		return identifiable;
// 	}
// 
// }


import com.google.common.collect.Lists;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Singular;
import lombok.SneakyThrows;
import lombok.Value;
import nl.tudelft.ewi.gitolite.objects.Identifiable;
import nl.tudelft.ewi.gitolite.objects.Identifier;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
package nl.tudelft.ewi.gitolite.parser.rules;



/**
 * @author Jan-Willem Gmelig Meyling
 */
@Value
@Builder
@EqualsAndHashCode
public class RepositoryRule implements Rule {

	/**
	 * Regex pattern for the repositories.
	 * Due to projects like gtk+, the + character is now considered a valid character for an ordinary repo.
	 * Therefore, a regex like foo/.+ does not look like a regex to gitolite. Use foo/..* if you want that.
	 * Also, ..* by itself is not considered a valid repo regex. Try [a-zA-Z0-9].*. CREATOR/..* will also work.
	 */
	@Singular
// Path: src/main/java/nl/tudelft/ewi/gitolite/objects/Identifiable.java
// public interface Identifiable extends Comparable<Identifiable>, Serializable {
// 
// 	String getPattern();
// 
// 	@Override
// 	default int compareTo(Identifiable o) {
// 		return getPattern().compareTo(o.getPattern());
// 	}
// 
// }
// 
// Path: src/main/java/nl/tudelft/ewi/gitolite/objects/Identifier.java
// @Value
// public class Identifier implements Identifiable {
// 
// 	/**
// 	 * The name for the identifier
// 	 */
// 	private final String pattern;
// 
// 	private final static WeakHashMap<String, WeakReference<Identifier>> identifiableMap = new WeakHashMap<>();
// 
// 	/**
// 	 * Get an identifier. As {@code Identifiers} should be immutable, they are stored in a
// 	 * {@code WeakHashMap} for caching purposes. This method tries to find {@code Identifiers}
// 	 * in the cache first, and only creates a new instance if not. Therefore, this method is
// 	 * preferred over using a constructor.
// 	 *
// 	 * @param name Name for the identifier.
// 	 * @return Identifier
// 	 */
// 	public static Identifier valueOf(String name) {
// 		WeakReference<Identifier> ref = identifiableMap.get(name);
// 		Identifier identifiable;
// 		if(ref == null || (identifiable = ref.get()) == null) {
// 			identifiable = new Identifier(name);
// 			identifiableMap.put(name, new WeakReference<>(identifiable));
// 		}
// 		return identifiable;
// 	}
// 
// }


// Path: src/main/java/nl/tudelft/ewi/gitolite/parser/rules/RepositoryRule.java
import com.google.common.collect.Lists;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Singular;
import lombok.SneakyThrows;
import lombok.Value;
import nl.tudelft.ewi.gitolite.objects.Identifiable;
import nl.tudelft.ewi.gitolite.objects.Identifier;
import java.io.IOException;
import java.io.StringWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

package nl.tudelft.ewi.gitolite.parser.rules;



/**
 * @author Jan-Willem Gmelig Meyling
 */
@Value
@Builder
@EqualsAndHashCode
public class RepositoryRule implements Rule {

	/**
	 * Regex pattern for the repositories.
	 * Due to projects like gtk+, the + character is now considered a valid character for an ordinary repo.
	 * Therefore, a regex like foo/.+ does not look like a regex to gitolite. Use foo/..* if you want that.
	 * Also, ..* by itself is not considered a valid repo regex. Try [a-zA-Z0-9].*. CREATOR/..* will also work.
	 */
	@Singular
	private final List<Identifiable> identifiables;