Last change
on this file since 992 was
992,
checked in by paucas, 13 years ago
|
- changed minor lowercasing spelling
|
File size:
1.1 KB
|
Line | |
---|
1 | package eu.clarin.cmdi.vlo.importer; |
---|
2 | |
---|
3 | import java.util.ArrayList; |
---|
4 | import java.util.List; |
---|
5 | |
---|
6 | import org.apache.solr.common.SolrInputDocument; |
---|
7 | |
---|
8 | public class CMDIData { |
---|
9 | |
---|
10 | private static final String METADATA_TYPE = "Metadata"; |
---|
11 | private String id; |
---|
12 | private List<String> resources = new ArrayList<String>(); |
---|
13 | private SolrInputDocument doc; |
---|
14 | |
---|
15 | public SolrInputDocument getSolrDocument() { |
---|
16 | return doc; |
---|
17 | } |
---|
18 | |
---|
19 | public void addDocField(String name, String value, boolean caseInsensitive) { |
---|
20 | if (doc == null) { |
---|
21 | doc = new SolrInputDocument(); |
---|
22 | } |
---|
23 | if (value != null && !value.isEmpty()) { |
---|
24 | if (caseInsensitive) { |
---|
25 | doc.addField(name, value.toLowerCase()); |
---|
26 | } else { |
---|
27 | doc.addField(name, value); |
---|
28 | } |
---|
29 | } |
---|
30 | } |
---|
31 | |
---|
32 | public List<String> getResources() { |
---|
33 | return resources; |
---|
34 | } |
---|
35 | |
---|
36 | public void addResource(String resource, String type) { |
---|
37 | if (METADATA_TYPE.equals(type)) { |
---|
38 | resources.add(resource); |
---|
39 | } |
---|
40 | } |
---|
41 | |
---|
42 | public void setId(String id) { |
---|
43 | this.id = id; |
---|
44 | } |
---|
45 | |
---|
46 | public String getId() { |
---|
47 | return id; |
---|
48 | } |
---|
49 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.