4141
4242import static java .util .Arrays .asList ;
4343import static no .digipost .api .client .representations .Relation .NEXT_DOCUMENTS ;
44- import static org .apache .commons .lang3 .ObjectUtils .defaultIfNull ;
44+ import static org .apache .commons .lang3 .ObjectUtils .getIfNull ;
4545
4646@ XmlAccessorType (XmlAccessType .FIELD )
4747@ XmlType (name = "archive" , propOrder = {
@@ -134,7 +134,7 @@ public Optional<URI> getNextDocumentsWithAttributes(Map<String, String> attribut
134134
135135 public Optional <URI > getNextDocumentsWithAttributesByDate (Map <String , String > attributes , OffsetDateTime from , OffsetDateTime to ) {
136136 final String attributesCommaSeparated = attributes .entrySet ().stream ().flatMap (en -> Stream .of (en .getKey (), en .getValue ())).collect (Collectors .joining ("," ));
137-
137+
138138 return Optional .ofNullable (getLinkByRelationName (NEXT_DOCUMENTS )).map (Link ::getUri )
139139 .map (uri -> {
140140 try {
@@ -150,7 +150,7 @@ public Optional<URI> getNextDocumentsWithAttributesByDate(Map<String, String> at
150150 }
151151
152152 public Optional <URI > getNextDocumentsByDate (OffsetDateTime from , OffsetDateTime to ) {
153-
153+
154154 return Optional .ofNullable (getLinkByRelationName (NEXT_DOCUMENTS )).map (Link ::getUri )
155155 .map (uri -> {
156156 try {
@@ -202,7 +202,7 @@ public ArchiveBuilder documents(ArchiveDocument... documents) {
202202 }
203203
204204 public ArchiveBuilder documents (Iterable <ArchiveDocument > documents ) {
205- defaultIfNull (documents , Collections .<ArchiveDocument >emptyList ()).forEach (this .documents ::add );
205+ getIfNull (documents , Collections .<ArchiveDocument >emptyList ()).forEach (this .documents ::add );
206206 return this ;
207207 }
208208
@@ -218,5 +218,5 @@ public Archive build() {
218218 private static String base64 (String param ){
219219 return Base64 .getEncoder ().encodeToString (param .getBytes (StandardCharsets .UTF_8 ));
220220 }
221-
221+
222222}
0 commit comments