relax list type for Marc record constructor to collection
This commit is contained in:
parent
0f251114a3
commit
89354c7bcc
3 changed files with 9 additions and 4 deletions
2
gradle.properties
vendored
2
gradle.properties
vendored
|
@ -1,5 +1,5 @@
|
||||||
group = org.xbib
|
group = org.xbib
|
||||||
name = marc
|
name = marc
|
||||||
version = 2.12.0
|
version = 2.13.0
|
||||||
|
|
||||||
org.gradle.warning.mode = ALL
|
org.gradle.warning.mode = ALL
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class MarcRecord implements Map<String, Object> {
|
||||||
|
|
||||||
private transient RecordLabel recordLabel;
|
private transient RecordLabel recordLabel;
|
||||||
|
|
||||||
private transient List<MarcField> marcFields;
|
private transient Collection<MarcField> marcFields;
|
||||||
|
|
||||||
private MarcRecord(Map<String, Object> delegate) {
|
private MarcRecord(Map<String, Object> delegate) {
|
||||||
this.delegate = delegate;
|
this.delegate = delegate;
|
||||||
|
@ -86,7 +86,7 @@ public class MarcRecord implements Map<String, Object> {
|
||||||
public MarcRecord(String format,
|
public MarcRecord(String format,
|
||||||
String type,
|
String type,
|
||||||
RecordLabel recordLabel,
|
RecordLabel recordLabel,
|
||||||
List<MarcField> marcFields,
|
Collection<MarcField> marcFields,
|
||||||
boolean lightweight,
|
boolean lightweight,
|
||||||
Comparator<String> comparator) {
|
Comparator<String> comparator) {
|
||||||
this.format = format;
|
this.format = format;
|
||||||
|
@ -183,7 +183,7 @@ public class MarcRecord implements Map<String, Object> {
|
||||||
*
|
*
|
||||||
* @return the MARC field list
|
* @return the MARC field list
|
||||||
*/
|
*/
|
||||||
public List<MarcField> getFields() {
|
public Collection<MarcField> getFields() {
|
||||||
return marcFields;
|
return marcFields;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -308,4 +308,9 @@ public class MarcRecordTest {
|
||||||
marcRecord.all("001", field -> assertEquals("123", field.getValue()));
|
marcRecord.all("001", field -> assertEquals("123", field.getValue()));
|
||||||
marcRecord.all("100", field -> assertEquals("Hello World", field.getFirstSubfieldValue("a")));
|
marcRecord.all("100", field -> assertEquals("Hello World", field.getFirstSubfieldValue("a")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testMarcRecordBuildWithUniqueFields() {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue