Changeset 7281


Ignore:
Timestamp:
01/10/22 12:16:20 (2 years ago)
Author:
Oliver Schonefeld
Message:
  • cleanup
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  
    269269        }
    270270        if (extraRequestData == null) {
    271             extraRequestData = new HashMap<String, String>();
     271            extraRequestData = new HashMap<>();
    272272        }
    273273        extraRequestData.put(name, value);
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUAbstractResponse.java

    r7272 r7281  
    126126    /**
    127127     * Get the number of diagnostics in the response.
    128      * 
     128     *
    129129     * <p>
    130130     * NB: Surrogate diagnostics are not covered by this.
     
    165165     * Return the number of extra response data records attached to the
    166166     * response.
    167      * 
     167     *
    168168     * @return the number of records, or <code>0</code> is none
    169169     */
     
    171171        return (extraResponseData != null) ? extraResponseData.size() : 0;
    172172    }
    173    
    174    
     173
     174
    175175    /**
    176176     * Get the extra response data of a specific class for this result.
     
    195195                if (clazz.isInstance(i)) {
    196196                    if (result == null) {
    197                         result = new ArrayList<V>();
     197                        result = new ArrayList<>();
    198198                    }
    199199                    result.add(clazz.cast(i));
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUClient.java

    r7272 r7281  
    7676    /* other fields */
    7777    private final DocumentBuilder documentBuilder;
    78     private final Deque<Node> stack = new ArrayDeque<Node>();
     78    private final Deque<Node> stack = new ArrayDeque<>();
    7979
    8080
     
    251251    private void addTerm(SRUTerm term) {
    252252        if (terms == null) {
    253             terms = new LinkedList<SRUTerm>();
     253            terms = new LinkedList<>();
    254254        }
    255255        terms.add(term);
     
    259259    private void addRecord(SRURecord record) {
    260260        if (records == null) {
    261             records = new LinkedList<SRURecord>();
     261            records = new LinkedList<>();
    262262        }
    263263        records.add(record);
     
    353353                    if (SRUClient.this.extraResponseData == null) {
    354354                        SRUClient.this.extraResponseData =
    355                                 new ArrayList<SRUExtraResponseData>();
     355                                new ArrayList<>();
    356356                    }
    357357                    SRUClient.this.extraResponseData.add(data);
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUClientConfig.java

    r7272 r7281  
    7979    /**
    8080     * Get the customized HTTP client which is to be used.
    81      * 
     81     *
    8282     * @return a configured HTTP client instance or <code>null</code>
    8383     */
     
    8989    /**
    9090     * Get the request authenticator
    91      * 
     91     *
    9292     * @return the configured request authenticator or <code>null</code>
    9393     */
     
    100100     * Get the HTTP client context which is to be used. Only relevant, if a
    101101     * customized HTTP client is set, see {{@link #getCustomizedHttpClient()}.
    102      * 
     102     *
    103103     * @return a HTTP client context instance or <code>null</code>
    104104     */
     
    186186                Runtime.getRuntime().availableProcessors() * 2;
    187187        private List<SRURecordDataParser> recordParsers =
    188                 new ArrayList<SRURecordDataParser>();
     188                new ArrayList<>();
    189189        private List<SRUExtraResponseDataParser> extraDataParsers = null;
    190190
     
    259259        /**
    260260         * Set a customized HTTP client which is to be used.
    261          * 
     261         *
    262262         * @param httpClient
    263263         *            a configured HTTP client instance
     
    273273         * Optionally set the HTTP context which is to be used by the customized
    274274         * HTTP client.
    275          * 
     275         *
    276276         * @param httpContext
    277277         *            a HTTP context instance
     
    360360            }
    361361            if (extraDataParsers == null) {
    362                 extraDataParsers = new ArrayList<SRUExtraResponseDataParser>();
     362                extraDataParsers = new ArrayList<>();
    363363            }
    364364            extraDataParsers.add(parser);
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUExplainRecordDataParser.java

    r7272 r7281  
    191191        }
    192192
    193         Set<String> transports = new HashSet<String>();
     193        Set<String> transports = new HashSet<>();
    194194        s = XmlStreamReaderUtils.readAttributeValue(reader, null, "transport");
    195195        if (s != null) {
     
    296296                        parseStringI18N(reader, strict, ns, "title", true);
    297297                if (title == null) {
    298                     title = new ArrayList<LocalizedString>();
     298                    title = new ArrayList<>();
    299299                }
    300300                title.add(s);
     
    326326                        parseStringI18N(reader, strict, ns, "description", true);
    327327                if (description == null) {
    328                     description = new ArrayList<LocalizedString>();
     328                    description = new ArrayList<>();
    329329                }
    330330                description.add(s);
     
    334334                        parseStringI18N(reader, strict, ns, "author", true);
    335335                if (author == null) {
    336                     author = new ArrayList<LocalizedString>();
     336                    author = new ArrayList<>();
    337337                }
    338338                author.add(s);
     
    342342                        parseStringI18N(reader, strict, ns, "contact", true);
    343343                if (contact == null) {
    344                     contact = new ArrayList<LocalizedString>();
     344                    contact = new ArrayList<>();
    345345                }
    346346                contact.add(s);
     
    350350                        parseStringI18N(reader, strict, ns, "extent", true);
    351351                if (extent == null) {
    352                     extent = new ArrayList<LocalizedString>();
     352                    extent = new ArrayList<>();
    353353                }
    354354                extent.add(s);
     
    358358                        parseStringI18N(reader, strict, ns, "history", true);
    359359                if (history == null) {
    360                     history = new ArrayList<LocalizedString>();
     360                    history = new ArrayList<>();
    361361                }
    362362                history.add(s);
     
    367367                        parseStringI18N(reader, strict, ns, "restrictions", true);
    368368                if (restrictions == null) {
    369                     restrictions = new ArrayList<LocalizedString>();
     369                    restrictions = new ArrayList<>();
    370370                }
    371371                restrictions.add(s);
     
    375375                        parseStringI18N(reader, strict, ns, "subjects", true);
    376376                if (subjects == null) {
    377                     subjects = new ArrayList<LocalizedString>();
     377                    subjects = new ArrayList<>();
    378378                }
    379379                subjects.add(s);
     
    383383                        parseStringI18N(reader, strict, ns, "links", true);
    384384                if (links == null) {
    385                     links = new ArrayList<LocalizedString>();
     385                    links = new ArrayList<>();
    386386                }
    387387                links.add(s);
     
    392392                        parseStringI18N(reader, strict, ns, "implementation", true);
    393393                if (implementation == null) {
    394                     implementation = new ArrayList<LocalizedString>();
     394                    implementation = new ArrayList<>();
    395395                }
    396396                implementation.add(s);
     
    439439                    }
    440440                    if (titles == null) {
    441                         titles = new ArrayList<LocalizedString>();
     441                        titles = new ArrayList<>();
    442442                    }
    443443                    titles.add(title);
     
    446446
    447447                if (sets == null) {
    448                     sets = new ArrayList<IndexInfo.Set>();
     448                    sets = new ArrayList<>();
    449449                }
    450450                sets.add(new IndexInfo.Set(identifier, name, titles));
     
    471471                    }
    472472                    if (titles == null) {
    473                         titles = new ArrayList<LocalizedString>();
     473                        titles = new ArrayList<>();
    474474                    }
    475475                    titles.add(title);
     
    508508                        if ((set != null) && (name != null)) {
    509509                            if (maps == null) {
    510                                 maps = new ArrayList<IndexInfo.Index.Map>();
     510                                maps = new ArrayList<>();
    511511                            }
    512512                            maps.add(new IndexInfo.Index.Map(primary, set, name));
     
    531531                XmlStreamReaderUtils.readEnd(reader, ns, "index");
    532532                if (indexes == null) {
    533                     indexes = new ArrayList<IndexInfo.Index>();
     533                    indexes = new ArrayList<>();
    534534                }
    535535                indexes.add(new IndexInfo.Index(id, titles, can_search,
     
    681681                }
    682682                if (titles == null) {
    683                     titles = new ArrayList<LocalizedString>();
     683                    titles = new ArrayList<>();
    684684                }
    685685                titles.add(title);
     
    688688
    689689            if (schemaInfo == null) {
    690                 schemaInfo = new ArrayList<Schema>();
     690                schemaInfo = new ArrayList<>();
    691691            }
    692692            schemaInfo.add(new Schema(identifier, name, location, sort,
     
    711711        if ((type != null) && (value != null)) {
    712712            if (map == null) {
    713                 map = new HashMap<String, String>();
     713                map = new HashMap<>();
    714714            }
    715715            if (map.containsKey(type)) {
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUScanResponse.java

    r7272 r7281  
    7070    /**
    7171     * Get the number of terms returned by the request.
    72      * 
     72     *
    7373     * @return the number of terms or <code>0</code> if none
    7474     */
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSearchRetrieveResponse.java

    r7272 r7281  
    112112    /**
    113113     * Get the number of records returned by the request.
    114      * 
     114     *
    115115     * @return number of records or <code>0</code> if none
    116116     */
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUSimpleClient.java

    r7272 r7281  
    114114                    "no record data parsers registered");
    115115        }
    116         this.parsers = new HashMap<String, SRURecordDataParser>();
     116        this.parsers = new HashMap<>();
    117117        for (SRURecordDataParser parser : list) {
    118118            final String recordSchema = parser.getRecordSchema();
  • SRUClient/trunk/src/main/java/eu/clarin/sru/client/SRUVersion.java

    r7272 r7281  
    5151    };
    5252
    53    
     53
    5454    /**
    5555     * Get a numerical representation of the version.
    56      * 
     56     *
    5757     * @return numerical representation of the version
    5858     */
    5959    public abstract int getVersionNumber();
    60    
     60
    6161
    6262    public boolean isVersion(SRUVersion version) {
Note: See TracChangeset for help on using the changeset viewer.