add lambdas to logging API

This commit is contained in:
Jörg Prante 2020-05-05 20:23:17 +02:00
parent b123d27567
commit 970f62f44f
10 changed files with 10 additions and 11 deletions

View file

@ -1,6 +1,6 @@
group = org.xbib
name = marc
version = 2.2.0
version = 2.2.1
# main
xbib-content.version = 2.0.5

View file

@ -114,7 +114,7 @@ public enum BibliographicLevel {
case 's':
return SERIAL;
default:
logger.log(Level.FINEST, "unknown bibliographic level: " + ch);
logger.log(Level.FINEST, () -> "unknown bibliographic level: " + ch);
return UNSPECIFIED;
}
}

View file

@ -81,7 +81,7 @@ public enum DescriptiveCatalogingForm {
case 'u':
return UNKNOWN;
default:
logger.log(Level.FINEST, "unknown descriptive cataloging form: " + ch);
logger.log(Level.FINEST, () -> "unknown descriptive cataloging form: " + ch);
return NON_ISBD;
}
}

View file

@ -63,7 +63,7 @@ public enum Encoding {
case 'a':
return UCS_UNICODE;
default:
logger.log(Level.FINEST, "unknown encoding: " + ch);
logger.log(Level.FINEST, () -> "unknown encoding: " + ch);
return MARC8;
}
}

View file

@ -126,7 +126,7 @@ public enum EncodingLevel {
case 'z':
return NOT_APPLICABLE;
default:
logger.log(Level.FINEST, "unknown encoding level " + ch);
logger.log(Level.FINEST, () -> "unknown encoding level " + ch);
return FULL;
}
}

View file

@ -71,7 +71,7 @@ public enum MultipartResourceRecordLevel {
case 'c':
return PART_WITH_DEPENDENT_TITLE;
default:
logger.log(Level.FINEST, "unknown multipart resource record level: " + ch);
logger.log(Level.FINEST, () -> "unknown multipart resource record level: " + ch);
return NOT_SPECIFIED;
}
}

View file

@ -82,7 +82,7 @@ public enum RecordStatus {
case 'p':
return INCREASE_IN_ENCODING_LEVEL_FROM_PREPUBLICATION;
default:
logger.log(Level.FINEST, "unknown record status: " + ch);
logger.log(Level.FINEST, () -> "unknown record status: " + ch);
return UNKNOWN;
}
}

View file

@ -55,7 +55,7 @@ public enum TypeOfControl {
case 'a' :
return ARCHIVAL;
default:
logger.log(Level.FINEST, "unknown type of control: " + ch);
logger.log(Level.FINEST, () -> "unknown type of control: " + ch);
return UNSPECIFIED;
}
}

View file

@ -200,7 +200,7 @@ public enum TypeOfRecord {
case 't':
return LANGUAGE_MATERIAL_MANUSCRIPT_MARC21;
default:
logger.log(Level.FINEST, "unknown type of record: " + ch);
logger.log(Level.FINEST, () -> "unknown type of record: " + ch);
return UNSPECIFIED;
}
}

View file

@ -225,7 +225,7 @@ public class MarcFieldTransformer extends LinkedHashMap<String, MarcField> {
if (m.find()) {
if (repeatCounter > 99) {
repeatCounter = 99;
logger.log(Level.WARNING, "counter > 99, overflow in %s", marcField);
logger.log(Level.WARNING, () -> "counter > 99, overflow in " + marcField);
}
return m.replaceAll(String.format("%02d", repeatCounter));
}
@ -360,7 +360,6 @@ public class MarcFieldTransformer extends LinkedHashMap<String, MarcField> {
* @param map a map of mappable tags
* @return a MARC field tranformer
*/
@SuppressWarnings("unchecked")
public Builder from(Map<String, String> map) {
for (Map.Entry<String, String> entry : map.entrySet()) {
fromTo(entry.getKey(), entry.getValue());