-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCompositeSource.java
More file actions
36 lines (30 loc) · 924 Bytes
/
CompositeSource.java
File metadata and controls
36 lines (30 loc) · 924 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package org.variantsync.diffdetective.util;
import java.util.Arrays;
import java.util.List;
/**
* Represents a {@link Source} without arguments.
*/
public class CompositeSource implements Source {
private final String sourceExplanation;
private final List<Source> sources;
/**
* @param sourceExplanation is returned verbatim by {@link getSourceExplanation}
* @param sources is returned as immutable list by {@link getSources}
*/
public CompositeSource(String sourceExplanation, Source... sources) {
this.sourceExplanation = sourceExplanation;
this.sources = Arrays.asList(sources);
}
@Override
public String getSourceExplanation() {
return sourceExplanation;
}
@Override
public List<Source> getSources() {
return sources;
}
@Override
public String toString() {
return Source.shallowExplanation(this);
}
}