- Timestamp:
- 01/10/22 12:16:20 (2 years ago)
- Location:
- SRUClient/trunk/src/main/java/eu/clarin/sru/client
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUAbstractRequest.java
r7272 r7281 269 269 } 270 270 if (extraRequestData == null) { 271 extraRequestData = new HashMap< String, String>();271 extraRequestData = new HashMap<>(); 272 272 } 273 273 extraRequestData.put(name, value); -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUAbstractResponse.java
r7272 r7281 126 126 /** 127 127 * Get the number of diagnostics in the response. 128 * 128 * 129 129 * <p> 130 130 * NB: Surrogate diagnostics are not covered by this. … … 165 165 * Return the number of extra response data records attached to the 166 166 * response. 167 * 167 * 168 168 * @return the number of records, or <code>0</code> is none 169 169 */ … … 171 171 return (extraResponseData != null) ? extraResponseData.size() : 0; 172 172 } 173 174 173 174 175 175 /** 176 176 * Get the extra response data of a specific class for this result. … … 195 195 if (clazz.isInstance(i)) { 196 196 if (result == null) { 197 result = new ArrayList< V>();197 result = new ArrayList<>(); 198 198 } 199 199 result.add(clazz.cast(i)); -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUClient.java
r7272 r7281 76 76 /* other fields */ 77 77 private final DocumentBuilder documentBuilder; 78 private final Deque<Node> stack = new ArrayDeque< Node>();78 private final Deque<Node> stack = new ArrayDeque<>(); 79 79 80 80 … … 251 251 private void addTerm(SRUTerm term) { 252 252 if (terms == null) { 253 terms = new LinkedList< SRUTerm>();253 terms = new LinkedList<>(); 254 254 } 255 255 terms.add(term); … … 259 259 private void addRecord(SRURecord record) { 260 260 if (records == null) { 261 records = new LinkedList< SRURecord>();261 records = new LinkedList<>(); 262 262 } 263 263 records.add(record); … … 353 353 if (SRUClient.this.extraResponseData == null) { 354 354 SRUClient.this.extraResponseData = 355 new ArrayList< SRUExtraResponseData>();355 new ArrayList<>(); 356 356 } 357 357 SRUClient.this.extraResponseData.add(data); -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUClientConfig.java
r7272 r7281 79 79 /** 80 80 * Get the customized HTTP client which is to be used. 81 * 81 * 82 82 * @return a configured HTTP client instance or <code>null</code> 83 83 */ … … 89 89 /** 90 90 * Get the request authenticator 91 * 91 * 92 92 * @return the configured request authenticator or <code>null</code> 93 93 */ … … 100 100 * Get the HTTP client context which is to be used. Only relevant, if a 101 101 * customized HTTP client is set, see {{@link #getCustomizedHttpClient()}. 102 * 102 * 103 103 * @return a HTTP client context instance or <code>null</code> 104 104 */ … … 186 186 Runtime.getRuntime().availableProcessors() * 2; 187 187 private List<SRURecordDataParser> recordParsers = 188 new ArrayList< SRURecordDataParser>();188 new ArrayList<>(); 189 189 private List<SRUExtraResponseDataParser> extraDataParsers = null; 190 190 … … 259 259 /** 260 260 * Set a customized HTTP client which is to be used. 261 * 261 * 262 262 * @param httpClient 263 263 * a configured HTTP client instance … … 273 273 * Optionally set the HTTP context which is to be used by the customized 274 274 * HTTP client. 275 * 275 * 276 276 * @param httpContext 277 277 * a HTTP context instance … … 360 360 } 361 361 if (extraDataParsers == null) { 362 extraDataParsers = new ArrayList< SRUExtraResponseDataParser>();362 extraDataParsers = new ArrayList<>(); 363 363 } 364 364 extraDataParsers.add(parser); -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUExplainRecordDataParser.java
r7272 r7281 191 191 } 192 192 193 Set<String> transports = new HashSet< String>();193 Set<String> transports = new HashSet<>(); 194 194 s = XmlStreamReaderUtils.readAttributeValue(reader, null, "transport"); 195 195 if (s != null) { … … 296 296 parseStringI18N(reader, strict, ns, "title", true); 297 297 if (title == null) { 298 title = new ArrayList< LocalizedString>();298 title = new ArrayList<>(); 299 299 } 300 300 title.add(s); … … 326 326 parseStringI18N(reader, strict, ns, "description", true); 327 327 if (description == null) { 328 description = new ArrayList< LocalizedString>();328 description = new ArrayList<>(); 329 329 } 330 330 description.add(s); … … 334 334 parseStringI18N(reader, strict, ns, "author", true); 335 335 if (author == null) { 336 author = new ArrayList< LocalizedString>();336 author = new ArrayList<>(); 337 337 } 338 338 author.add(s); … … 342 342 parseStringI18N(reader, strict, ns, "contact", true); 343 343 if (contact == null) { 344 contact = new ArrayList< LocalizedString>();344 contact = new ArrayList<>(); 345 345 } 346 346 contact.add(s); … … 350 350 parseStringI18N(reader, strict, ns, "extent", true); 351 351 if (extent == null) { 352 extent = new ArrayList< LocalizedString>();352 extent = new ArrayList<>(); 353 353 } 354 354 extent.add(s); … … 358 358 parseStringI18N(reader, strict, ns, "history", true); 359 359 if (history == null) { 360 history = new ArrayList< LocalizedString>();360 history = new ArrayList<>(); 361 361 } 362 362 history.add(s); … … 367 367 parseStringI18N(reader, strict, ns, "restrictions", true); 368 368 if (restrictions == null) { 369 restrictions = new ArrayList< LocalizedString>();369 restrictions = new ArrayList<>(); 370 370 } 371 371 restrictions.add(s); … … 375 375 parseStringI18N(reader, strict, ns, "subjects", true); 376 376 if (subjects == null) { 377 subjects = new ArrayList< LocalizedString>();377 subjects = new ArrayList<>(); 378 378 } 379 379 subjects.add(s); … … 383 383 parseStringI18N(reader, strict, ns, "links", true); 384 384 if (links == null) { 385 links = new ArrayList< LocalizedString>();385 links = new ArrayList<>(); 386 386 } 387 387 links.add(s); … … 392 392 parseStringI18N(reader, strict, ns, "implementation", true); 393 393 if (implementation == null) { 394 implementation = new ArrayList< LocalizedString>();394 implementation = new ArrayList<>(); 395 395 } 396 396 implementation.add(s); … … 439 439 } 440 440 if (titles == null) { 441 titles = new ArrayList< LocalizedString>();441 titles = new ArrayList<>(); 442 442 } 443 443 titles.add(title); … … 446 446 447 447 if (sets == null) { 448 sets = new ArrayList< IndexInfo.Set>();448 sets = new ArrayList<>(); 449 449 } 450 450 sets.add(new IndexInfo.Set(identifier, name, titles)); … … 471 471 } 472 472 if (titles == null) { 473 titles = new ArrayList< LocalizedString>();473 titles = new ArrayList<>(); 474 474 } 475 475 titles.add(title); … … 508 508 if ((set != null) && (name != null)) { 509 509 if (maps == null) { 510 maps = new ArrayList< IndexInfo.Index.Map>();510 maps = new ArrayList<>(); 511 511 } 512 512 maps.add(new IndexInfo.Index.Map(primary, set, name)); … … 531 531 XmlStreamReaderUtils.readEnd(reader, ns, "index"); 532 532 if (indexes == null) { 533 indexes = new ArrayList< IndexInfo.Index>();533 indexes = new ArrayList<>(); 534 534 } 535 535 indexes.add(new IndexInfo.Index(id, titles, can_search, … … 681 681 } 682 682 if (titles == null) { 683 titles = new ArrayList< LocalizedString>();683 titles = new ArrayList<>(); 684 684 } 685 685 titles.add(title); … … 688 688 689 689 if (schemaInfo == null) { 690 schemaInfo = new ArrayList< Schema>();690 schemaInfo = new ArrayList<>(); 691 691 } 692 692 schemaInfo.add(new Schema(identifier, name, location, sort, … … 711 711 if ((type != null) && (value != null)) { 712 712 if (map == null) { 713 map = new HashMap< String, String>();713 map = new HashMap<>(); 714 714 } 715 715 if (map.containsKey(type)) { -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUScanResponse.java
r7272 r7281 70 70 /** 71 71 * Get the number of terms returned by the request. 72 * 72 * 73 73 * @return the number of terms or <code>0</code> if none 74 74 */ -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSearchRetrieveResponse.java
r7272 r7281 112 112 /** 113 113 * Get the number of records returned by the request. 114 * 114 * 115 115 * @return number of records or <code>0</code> if none 116 116 */ -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSimpleClient.java
r7272 r7281 114 114 "no record data parsers registered"); 115 115 } 116 this.parsers = new HashMap< String, SRURecordDataParser>();116 this.parsers = new HashMap<>(); 117 117 for (SRURecordDataParser parser : list) { 118 118 final String recordSchema = parser.getRecordSchema(); -
SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUVersion.java
r7272 r7281 51 51 }; 52 52 53 53 54 54 /** 55 55 * Get a numerical representation of the version. 56 * 56 * 57 57 * @return numerical representation of the version 58 58 */ 59 59 public abstract int getVersionNumber(); 60 60 61 61 62 62 public boolean isVersion(SRUVersion version) {
Note: See TracChangeset
for help on using the changeset viewer.