public MarcField transformValue ( MarcField field ) { String key = field . toTagIndicatorKey ( ) ; if ( marcValueTransformerMap . isEmpty ( ) ) { return field ; } final MarcValueTransformer transformer = marcValueTransformerMap . containsKey ( key ) ? marcValueTransformerMap . get ( key ) : marcValueTransformerMap . get ( DEFAULT ) ; if ( transformer != null ) { MarcField . Builder builder = MarcField . builder ( ) ; builder . tag ( field . getTag ( ) ) . indicator ( field . getIndicator ( ) ) ; if ( field . getValue ( ) != null ) { builder . value ( transformer . transform ( field . getValue ( ) ) ) ; } // select only subfields configured for this tag String subs = subfieldMap . containsKey ( key ) ? subfieldMap . get ( key ) : field . getSubfieldIds ( ) ; field . getSubfields ( ) . forEach ( subfield -> builder . subfield ( subfield . getId ( ) , subs . contains ( subfield . getId ( ) ) ? transformer . transform ( subfield . getValue ( ) ) : subfield . getValue ( ) ) ) ; return builder . build ( ) ; } return field ; }
Transform value .