relax list type for Marc record constructor to collection

This commit is contained in:
Jörg Prante 2023-08-14 19:05:19 +02:00
parent 0f251114a3
commit 89354c7bcc
3 changed files with 9 additions and 4 deletions

2
gradle.properties vendored
View file

@ -1,5 +1,5 @@
group = org.xbib
name = marc
version = 2.12.0
version = 2.13.0
org.gradle.warning.mode = ALL

View file

@ -67,7 +67,7 @@ public class MarcRecord implements Map<String, Object> {
private transient RecordLabel recordLabel;
private transient List<MarcField> marcFields;
private transient Collection<MarcField> marcFields;
private MarcRecord(Map<String, Object> delegate) {
this.delegate = delegate;
@ -86,7 +86,7 @@ public class MarcRecord implements Map<String, Object> {
public MarcRecord(String format,
String type,
RecordLabel recordLabel,
List<MarcField> marcFields,
Collection<MarcField> marcFields,
boolean lightweight,
Comparator<String> comparator) {
this.format = format;
@ -183,7 +183,7 @@ public class MarcRecord implements Map<String, Object> {
*
* @return the MARC field list
*/
public List<MarcField> getFields() {
public Collection<MarcField> getFields() {
return marcFields;
}

View file

@ -308,4 +308,9 @@ public class MarcRecordTest {
marcRecord.all("001", field -> assertEquals("123", field.getValue()));
marcRecord.all("100", field -> assertEquals("Hello World", field.getFirstSubfieldValue("a")));
}
@Test
public void testMarcRecordBuildWithUniqueFields() {
}
}