Mercurial > hg4j
comparison hg4j/src/main/java/org/tmatesoft/hg/internal/Filter.java @ 213:6ec4af642ba8 gradle
Project uses Gradle for build - actual changes
author | Alexander Kitaev <kitaev@gmail.com> |
---|---|
date | Tue, 10 May 2011 10:52:53 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
212:edb2e2829352 | 213:6ec4af642ba8 |
---|---|
1 /* | |
2 * Copyright (c) 2011 TMate Software Ltd | |
3 * | |
4 * This program is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; version 2 of the License. | |
7 * | |
8 * This program is distributed in the hope that it will be useful, | |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 * GNU General Public License for more details. | |
12 * | |
13 * For information on how to redistribute this software under | |
14 * the terms of a license other than GNU General Public License | |
15 * contact TMate Software at support@hg4j.com | |
16 */ | |
17 package org.tmatesoft.hg.internal; | |
18 | |
19 import java.nio.ByteBuffer; | |
20 | |
21 import org.tmatesoft.hg.repo.HgRepository; | |
22 import org.tmatesoft.hg.util.Path; | |
23 | |
24 /** | |
25 * | |
26 * @author Artem Tikhomirov | |
27 * @author TMate Software Ltd. | |
28 */ | |
29 public interface Filter { | |
30 | |
31 // returns a buffer ready to be read. may return original buffer. | |
32 // original buffer may not be fully consumed, #compact() might be operation to perform | |
33 ByteBuffer filter(ByteBuffer src); | |
34 | |
35 interface Factory { | |
36 void initialize(HgRepository hgRepo, ConfigFile cfg); | |
37 // may return null if for a given path and/or options this filter doesn't make any sense | |
38 Filter create(Path path, Options opts); | |
39 } | |
40 | |
41 enum Direction { | |
42 FromRepo, ToRepo | |
43 } | |
44 | |
45 public class Options { | |
46 | |
47 private final Direction direction; | |
48 public Options(Direction dir) { | |
49 direction = dir; | |
50 } | |
51 | |
52 Direction getDirection() { | |
53 return direction; | |
54 } | |
55 | |
56 } | |
57 } |