conversation
listlengths
2
2
[ { "content": "Decodes a string from Base64.\n@param str the encoded string\n@return a decoded string", "role": "user" }, { "content": "public static String base64dec(String str) {\n\t\tif (str == null) {\n\t\t\treturn \"\";\n\t\t}\n\t\ttry {\n\t\t\treturn new String(Base64.decodeBase64(str), Config....
[ { "content": "Formats the date for today, in a specific format.\n@param format the date format\n@param loc the locale instance\n@return today's date formatted", "role": "user" }, { "content": "public static String formatDate(String format, Locale loc) {\n\t\treturn formatDate(timestamp(), format, lo...
[ { "content": "Returns an array of the months in the Gregorian calendar.\n@param locale the locale used for the months' names\n@return an array of the 12 months", "role": "user" }, { "content": "public static String[] getMonths(Locale locale) {\n\t\tif (locale == null) {\n\t\t\tlocale = Locale.US;\n\...
[ { "content": "Round up a double using the \"half up\" method.\n@param d a double\n@param scale the scale\n@return a double", "role": "user" }, { "content": "public static double roundHalfUp(double d, int scale) {\n\t\treturn BigDecimal.valueOf(d).setScale(scale, RoundingMode.HALF_UP).doubleValue();\...
[ { "content": "Abbreviates an integer by adding a letter suffix at the end.\nE.g. \"M\" for millions, \"K\" for thousands, etc.\n@param number a big integer\n@param decPlaces decimal places\n@return the rounded integer as a string", "role": "user" }, { "content": "public static String abbreviateInt(N...
[ { "content": "Decodes a URL-encoded string.\n@param s a string\n@return the decoded string", "role": "user" }, { "content": "public static String urlDecode(String s) {\n\t\tif (s == null) {\n\t\t\treturn \"\";\n\t\t}\n\t\tString decoded = s;\n\t\ttry {\n\t\t\tdecoded = URLDecoder.decode(s, Config.DE...
[ { "content": "Returns the host part of the URL.\n@param url a URL\n@return just the host", "role": "user" }, { "content": "public static String getHostFromURL(String url) {\n\t\tURL u = toURL(url);\n\t\tString host = (u == null) ? \"\" : u.getHost();\n\t\treturn host;\n\t}", "role": "assistant" ...
[ { "content": "Returns the default URL for a given domain object.\n@param obj the domain object\n@param includeName true if we want to include the name of the object in the URL\n@param includeId true if we want to include the ID of the object in the URL\n@return the object's URL - e.g. /users/123-name, /users/, ...
[ { "content": "Checks if a response is of type JSON.\n@param contentType the value of \"Content-Type\" header\n@return true if JSON", "role": "user" }, { "content": "public static boolean isJsonType(String contentType) {\n\t\treturn StringUtils.startsWith(contentType, \"application/json\") ||\n\t\t\t...
[ { "content": "Quick and dirty singular to plural conversion.\n@param singul a word\n@return a guess of its plural form", "role": "user" }, { "content": "public static String singularToPlural(String singul) {\n\t\treturn (StringUtils.isBlank(singul) || singul.endsWith(\"es\") || singul.endsWith(\"ies...
[ { "content": "Checks if a class is primitive, String or a primitive wrapper.\n\n@param clazz a class\n@return true if primitive or wrapper", "role": "user" }, { "content": "public static boolean isBasicType(Class<?> clazz) {\n\t\treturn (clazz == null) ? false : (clazz.isPrimitive()\n\t\t\t\t|| claz...
[ { "content": "Returns a list of all declared fields in a class. Transient and serialVersionUID fields are skipped.\nThis method scans parent classes as well.\n@param clazz a class to scan\n@return a list of fields including those of the parent classes excluding the Object class.", "role": "user" }, { ...
[ { "content": "Returns the API request path.\n@return the request path without parameters", "role": "user" }, { "content": "public String getApiPath() {\n\t\tif (StringUtils.isBlank(path)) {\n\t\t\treturn DEFAULT_PATH;\n\t\t} else {\n\t\t\tif (!path.endsWith(\"/\")) {\n\t\t\t\tpath += \"/\";\n\t\t\t}...
[ { "content": "Sets the JWT access token.\n@param token a valid token", "role": "user" }, { "content": "@SuppressWarnings(\"unchecked\")\n\tpublic void setAccessToken(String token) {\n\t\tif (!StringUtils.isBlank(token)) {\n\t\t\ttry {\n\t\t\t\tString payload = Utils.base64dec(StringUtils.substringBe...
[ { "content": "Invoke a GET request to the Para API.\n@param resourcePath the subpath after '/v1/', should not start with '/'\n@param params query parameters\n@return a {@link Response} object", "role": "user" }, { "content": "public Response invokeGet(String resourcePath, MultivaluedMap<String, Stri...
[ { "content": "Invoke a POST request to the Para API.\n@param resourcePath the subpath after '/v1/', should not start with '/'\n@param entity request body\n@return a {@link Response} object", "role": "user" }, { "content": "public Response invokePost(String resourcePath, Entity<?> entity) {\n\t\tlogg...
[ { "content": "Invoke a DELETE request to the Para API.\n@param resourcePath the subpath after '/v1/', should not start with '/'\n@param params query parameters\n@return a {@link Response} object", "role": "user" }, { "content": "public Response invokeDelete(String resourcePath, MultivaluedMap<String...
[ { "content": "Converts a list of Maps to a List of ParaObjects, at a given path within the JSON tree structure.\n@param <P> type\n@param at the path (field) where the array of objects is located\n@param result the response body for an API request\n@param pager a {@link Pager} object\n@return a list of ParaObjec...
[ { "content": "Updates an object permanently. Supports partial updates.\n@param <P> the type of object\n@param obj the object to update\n@return the updated object", "role": "user" }, { "content": "public <P extends ParaObject> P update(P obj) {\n\t\tif (obj == null) {\n\t\t\treturn null;\n\t\t}\n\t\...
[ { "content": "Deletes an object permanently.\n@param <P> the type of object\n@param obj the object", "role": "user" }, { "content": "public <P extends ParaObject> void delete(P obj) {\n\t\tif (obj == null || obj.getId() == null) {\n\t\t\treturn;\n\t\t}\n\t\tinvokeDelete(obj.getType().concat(\"/\").c...
[ { "content": "Saves multiple objects to the data store.\n@param <P> the type of object\n@param objects the list of objects to save\n@return a list of objects", "role": "user" }, { "content": "public <P extends ParaObject> List<P> createAll(List<P> objects) {\n\t\tif (objects == null || objects.isEmp...
[ { "content": "Retrieves multiple objects from the data store.\n@param <P> the type of object\n@param keys a list of object ids\n@return a list of objects", "role": "user" }, { "content": "public <P extends ParaObject> List<P> readAll(List<String> keys) {\n\t\tif (keys == null || keys.isEmpty()) {\n\...
[ { "content": "Deletes multiple objects.\n@param keys the ids of the objects to delete", "role": "user" }, { "content": "public void deleteAll(List<String> keys) {\n\t\tif (keys == null || keys.isEmpty()) {\n\t\t\treturn;\n\t\t}\n\t\tfinal int size = this.chunkSize;\n\t\tIntStream.range(0, getNumChun...
[ { "content": "Returns a list all objects found for the given type.\nThe result is paginated so only one page of items is returned, at a time.\n@param <P> the type of object\n@param type the type of objects to search for\n@param pager a {@link com.erudika.para.utils.Pager}\n@return a list of objects", "role"...
[ { "content": "Simple id search.\n@param <P> type of the object\n@param id the id\n@return the object if found or null", "role": "user" }, { "content": "public <P extends ParaObject> P findById(String id) {\n\t\tMultivaluedMap<String, String> params = new MultivaluedHashMap<>();\n\t\tparams.putSingle...
[ { "content": "Simple multi id search.\n@param <P> type of the object\n@param ids a list of ids to search for\n@return a list of object found", "role": "user" }, { "content": "public <P extends ParaObject> List<P> findByIds(List<String> ids) {\n\t\tMultivaluedMap<String, String> params = new Multival...
[ { "content": "Searches for objects that have similar property values to a given text. A \"find like this\" query.\n@param <P> type of the object\n@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}\n@param filterKey exclude an object with this key from the result...
[ { "content": "Searches for objects tagged with one or more tags.\n@param <P> type of the object\n@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}\n@param tags the list of tags\n@param pager a {@link com.erudika.para.utils.Pager}\n@return a list of objects foun...
[ { "content": "Searches for objects having a property value that is in list of possible values.\n@param <P> type of the object\n@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}\n@param field the property name of an object\n@param terms a list of terms (property...
[ { "content": "Searches for objects that have properties matching some given values. A terms query.\n@param <P> type of the object\n@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}\n@param terms a map of fields (property names) to terms (property values)\n@para...
[ { "content": "Searches for objects that have a property with a value matching a wildcard query.\n@param <P> type of the object\n@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}\n@param field the property name of an object\n@param wildcard wildcard query string...
[ { "content": "Counts indexed objects.\n@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}\n@return the number of results found", "role": "user" }, { "content": "public Long getCount(String type) {\n\t\tMultivaluedMap<String, String> params = new Mult...
[ { "content": "Count the total number of links between this object and another type of object.\n@param type2 the other type of object\n@param obj the object to execute this method on\n@return the number of links for the given object", "role": "user" }, { "content": "@SuppressWarnings(\"unchecked\")\n...
[ { "content": "Returns all objects linked to the given one. Only applicable to many-to-many relationships.\n@param <P> type of linked objects\n@param type2 type of linked objects to search for\n@param obj the object to execute this method on\n@param pager a {@link com.erudika.para.utils.Pager}\n@return a list of...
[ { "content": "Checks if this object is linked to another.\n@param type2 the other type\n@param id2 the other id\n@param obj the object to execute this method on\n@return true if the two are linked", "role": "user" }, { "content": "public boolean isLinked(ParaObject obj, String type2, String id2) {\n...
[ { "content": "Checks if a given object is linked to this one.\n@param toObj the other object\n@param obj the object to execute this method on\n@return true if linked", "role": "user" }, { "content": "public boolean isLinked(ParaObject obj, ParaObject toObj) {\n\t\tif (obj == null || obj.getId() == n...
[ { "content": "Links an object to this one in a many-to-many relationship.\nOnly a link is created. Objects are left untouched.\nThe type of the second object is automatically determined on read.\n@param id2 link to the object with this id\n@param obj the object to execute this method on\n@return the id of the {...
[ { "content": "Unlinks an object from this one.\nOnly a link is deleted. Objects are left untouched.\n@param type2 the other type\n@param obj the object to execute this method on\n@param id2 the other id", "role": "user" }, { "content": "public void unlink(ParaObject obj, String type2, String id2) {\...
[ { "content": "Unlinks all objects that are linked to this one.\n@param obj the object to execute this method on\nOnly {@link com.erudika.para.core.Linker} objects are deleted.\n{@link com.erudika.para.core.ParaObject}s are left untouched.", "role": "user" }, { "content": "public void unlinkAll(ParaO...
[ { "content": "Returns all child objects linked to this object.\n@param <P> the type of children\n@param type2 the type of children to look for\n@param obj the object to execute this method on\n@param pager a {@link com.erudika.para.utils.Pager}\n@return a list of {@link ParaObject} in a one-to-many relationship...
[ { "content": "Deletes all child objects permanently.\n@param obj the object to execute this method on\n@param type2 the children's type.", "role": "user" }, { "content": "public void deleteChildren(ParaObject obj, String type2) {\n\t\tif (obj == null || obj.getId() == null || type2 == null) {\n\t\t\...
[ { "content": "Generates a new unique id.\n@return a new id", "role": "user" }, { "content": "public String newId() {\n\t\tString res = getEntity(invokeGet(\"utils/newid\", null), String.class);\n\t\treturn res != null ? res : \"\";\n\t}", "role": "assistant" } ]
[ { "content": "Returns the current timestamp.\n@return a long number", "role": "user" }, { "content": "public long getTimestamp() {\n\t\tLong res = getEntity(invokeGet(\"utils/timestamp\", null), Long.class);\n\t\treturn res != null ? res : 0L;\n\t}", "role": "assistant" } ]
[ { "content": "Verifies a given JWT and returns the authenticated subject. This request will not remember the JWT in memory.\n@param <P> an App or User\n@param accessToken a valid JWT access token\n@return a {@link com.erudika.para.core.User} or an {@link com.erudika.para.core.App}", "role": "user" }, { ...
[ { "content": "Downvote an object and register the vote in DB.\n@param obj the object to receive -1 votes\n@param voterid the userid of the voter\n@return true if vote was successful", "role": "user" }, { "content": "public boolean voteDown(ParaObject obj, String voterid) {\n\t\tif (obj == null || St...
[ { "content": "Rebuilds the entire search index.\n@param destinationIndex an existing index as destination\n@return a response object with properties \"tookMillis\" and \"reindexed\"", "role": "user" }, { "content": "public Map<String, Object> rebuildIndex(String destinationIndex) {\n\t\tMultivaluedM...
[ { "content": "Add a new constraint for a given field.\n@param type a type\n@param field a field name\n@param c the constraint\n@return a map containing all validation constraints for this type.", "role": "user" }, { "content": "public Map<String, Map<String, Map<String, Map<String, ?>>>> addValidati...
[ { "content": "Removes a validation constraint for a given field.\n@param type a type\n@param field a field name\n@param constraintName the name of the constraint to remove\n@return a map containing all validation constraints for this type.", "role": "user" }, { "content": "public Map<String, Map<Str...
[ { "content": "Returns the permissions for all subjects and resources for current app.\n@return a map of subject ids to resource names to a list of allowed methods", "role": "user" }, { "content": "public Map<String, Map<String, List<String>>> resourcePermissions() {\n\t\treturn getEntity(invokeGet(\...
[ { "content": "Revokes a permission for a subject, meaning they no longer will be able to access the given resource.\n@param subjectid subject id (user id)\n@param resourcePath resource path or object type\n@return a map of the permissions for this subject id", "role": "user" }, { "content": "public ...
[ { "content": "Revokes all permission for a subject.\n@param subjectid subject id (user id)\n@return a map of the permissions for this subject id", "role": "user" }, { "content": "public Map<String, Map<String, List<String>>> revokeAllResourcePermissions(String subjectid) {\n\t\tif (StringUtils.isBla...
[ { "content": "Adds or overwrites an app-specific setting.\n@param key a key\n@param value a value", "role": "user" }, { "content": "public void addAppSetting(String key, Object value) {\n\t\tif (!StringUtils.isBlank(key) && value != null) {\n\t\t\tinvokePut(Utils.formatMessage(\"_settings/{0}\", key...
[ { "content": "Removes an app-specific setting.\n@param key a key", "role": "user" }, { "content": "public void removeAppSetting(String key) {\n\t\tif (!StringUtils.isBlank(key)) {\n\t\t\tinvokeDelete(Utils.formatMessage(\"_settings/{0}\", key), null);\n\t\t}\n\t}", "role": "assistant" } ]
[ { "content": "Add a specific value to a registry. If the registry doesn't exist yet, create it.\n@param registryName the name of the registry.\n@param key the unique key corresponding to the value to insert (typically an appid).\n@param value the value to add to the registry.", "role": "user" }, { "...
[ { "content": "Retrieve one specific value from a registry.\n@param registryName the name of the registry.\n@param key the unique key corresponding to the value to retrieve (typically an appid).\n@return the value corresponding to the registry key, null if no value is found for the specified key.", "role": "...
[ { "content": "Remove a specific value from a registry.\n@param registryName the name of the registry.\n@param key the unique key corresponding to the value to remove (typically an appid).", "role": "user" }, { "content": "public static void removeValue(String registryName, String key) {\n\t\tSysprop...
[ { "content": "Retrieve an entire registry.\n@param registryName the name of the registry.\n@return the map of all registry values, null if no registry is found by the specified name.", "role": "user" }, { "content": "public static Map<String, Object> getRegistry(String registryName) {\n\t\tif (Strin...
[ { "content": "Authenticates an application or user or guest.\n@param req a request\n@param res a response\n@param chain filter chain\n@throws IOException ex\n@throws ServletException ex", "role": "user" }, { "content": "@Override\n\tpublic void doFilter(ServletRequest req, ServletResponse res, Filte...
[ { "content": "Returns a client instance for AWS SQS.\n@return a client that talks to SQS", "role": "user" }, { "content": "public static AmazonSQS getClient() {\n\t\tif (sqsClient != null) {\n\t\t\treturn sqsClient;\n\t\t}\n\t\tif (Config.IN_PRODUCTION) {\n\t\t\tsqsClient = AmazonSQSClientBuilder.st...
[ { "content": "Creates a new SQS queue on AWS.\n@param name queue name\n@return the queue URL or null", "role": "user" }, { "content": "public static String createQueue(String name) {\n\t\tif (StringUtils.isBlank(name)) {\n\t\t\treturn null;\n\t\t}\n\t\tString queueURL = getQueueURL(name);\n\t\tif (q...
[ { "content": "Deletes an SQS queue on AWS.\n@param queueURL URL of the SQS queue", "role": "user" }, { "content": "public static void deleteQueue(String queueURL) {\n\t\tif (!StringUtils.isBlank(queueURL)) {\n\t\t\ttry {\n\t\t\t\tgetClient().deleteQueue(new DeleteQueueRequest(queueURL));\n\t\t\t} ca...
[ { "content": "Returns the SQS queue URL.\n@param name queue name\n@return the URL of the queue", "role": "user" }, { "content": "public static String getQueueURL(String name) {\n\t\ttry {\n\t\t\treturn getClient().getQueueUrl(name).getQueueUrl();\n\t\t} catch (Exception e) {\n\t\t\tlogger.info(\"Que...
[ { "content": "Returns a list of URLs for all available queues on SQS.\n@return a list or queue URLs", "role": "user" }, { "content": "public static List<String> listQueues() {\n\t\tList<String> list = new ArrayList<>();\n\t\ttry {\n\t\t\tlist = getClient().listQueues().getQueueUrls();\n\t\t} catch (...
[ { "content": "Pushes a number of messages in batch to an SQS queue.\n@param queueURL the URL of the SQS queue\n@param messages the massage bodies", "role": "user" }, { "content": "public static void pushMessages(String queueURL, List<String> messages) {\n\t\tif (!StringUtils.isBlank(queueURL) && mes...
[ { "content": "Pulls a number of messages from an SQS queue.\n@param queueURL the URL of the SQS queue\n@param numberOfMessages the number of messages to pull\n@return a list of messages", "role": "user" }, { "content": "public static List<String> pullMessages(String queueURL, int numberOfMessages) {...
[ { "content": "Starts polling for messages from SQS in a separate thread.\n@param queueURL a queue URL", "role": "user" }, { "content": "public static void startPollingForMessages(final String queueURL) {\n\t\tif (!StringUtils.isBlank(queueURL) && !POLLING_THREADS.containsKey(queueURL)) {\n\t\t\tlogg...
[ { "content": "Stops the thread that has been polling for messages.\n@param queueURL the queue URL", "role": "user" }, { "content": "public static void stopPollingForMessages(String queueURL) {\n\t\tif (!StringUtils.isBlank(queueURL) && POLLING_THREADS.containsKey(queueURL)) {\n\t\t\tlogger.info(\"St...
[ { "content": "Get the nested objects that are linked by this link.\n@return a 2-element array of objects or null", "role": "user" }, { "content": "public List<Map<String, Object>> getNstd() {\n\t\tif (nstd == null) {\n\t\t\tnstd = new ArrayList<>();\n\t\t}\n\t\treturn nstd;\n\t}", "role": "assis...
[ { "content": "Add an object to nest inside the linker object.\nUsed for joining queries when searching objects in a many-to-many relationship.\n@param obj object", "role": "user" }, { "content": "public void addNestedObject(ParaObject obj) {\n\t\tif (obj != null) {\n\t\t\tgetNstd().add(ParaObjectUti...
[ { "content": "Saves a CSRF token in cache.\n@param t (ignored)\n@param request HTTP request\n@param response HTTP response", "role": "user" }, { "content": "public void saveToken(CsrfToken t, HttpServletRequest request, HttpServletResponse response) {\n\t\tString ident = getIdentifierFromCookie(requ...
[ { "content": "Loads a CSRF token from cache.\n@param request HTTP request\n@return the token", "role": "user" }, { "content": "public CsrfToken loadToken(HttpServletRequest request) {\n\t\tCsrfToken token = null;\n\t\tString ident = getIdentifierFromCookie(request);\n\t\tif (ident != null) {\n\t\t\t...
[ { "content": "Finds the longest common Ancestor ending at Array", "role": "user" }, { "content": "private static JsonPointer computeRelativePath(JsonPointer path, int startIdx, int endIdx, List<Diff> diffs) {\n List<Integer> counters = new ArrayList<Integer>(path.size());\n for (int i ...
[ { "content": "Parses a valid string representation of a JSON Pointer.\n\n@param path The string representation to be parsed.\n@return An instance of {@link JsonPointer} conforming to the specified string representation.\n@throws IllegalArgumentException The specified JSON Pointer is invalid.", "role": "user...
[ { "content": "Creates a new JSON pointer to the specified field of the object referenced by this instance.\n\n@param field The desired field name, or any valid JSON Pointer reference token\n@return The new {@link JsonPointer} instance.", "role": "user" }, { "content": "JsonPointer append(String fiel...
[ { "content": "Retrieves the reference token at the specified index.\n\n@param index The desired reference token index.\n@return The specified instance of {@link RefToken}.\n@throws IndexOutOfBoundsException The specified index is illegal.", "role": "user" }, { "content": "public RefToken get(int ind...
[ { "content": "Takes a target document and resolves the node represented by this instance.\n\nThe evaluation semantics are described in\n<a href=\"https://tools.ietf.org/html/rfc6901#section-4\">RFC 6901 sectino 4</a>.\n\n@param document The target document against which to evaluate the JSON pointer.\n@return Th...
[ { "content": "Adds a field to the statistics to be requested.\n\n@param field\n@return", "role": "user" }, { "content": "public FieldStatsOptions addField(Field field) {\n\n\t\tAssert.notNull(field, \"Field for statistics must not be 'null'.\");\n\n\t\tstate.fields.add(field);\n\t\treturn new FieldS...
[ { "content": "Adds a field via its name to the statistics to be requested.\n\n@param fieldName\n@return", "role": "user" }, { "content": "public FieldStatsOptions addField(String fieldName) {\n\n\t\tAssert.hasText(fieldName, \"Fieldname for statistics must not be blank.\");\n\n\t\treturn addField(ne...
[ { "content": "add grouping on field name\n\n@param fieldname must not be null\n@return\n@deprecated in favor of {@link GroupOptions}\n@see GroupOptions", "role": "user" }, { "content": "@Deprecated\n\tpublic final <T extends Query> T addGroupByField(String fieldname) {\n\t\treturn addGroupByField(ne...
[ { "content": "This parameter prefix can be used to specify any additional parameters that you wish to the Spellchecker to use\nwhen internally validating collation queries.\n\n@param param\n@param value\n@return", "role": "user" }, { "content": "public SpellcheckOptions collateParam(String param, Ob...
[ { "content": "Add field to highlight\n\n@param field\n@return", "role": "user" }, { "content": "public HighlightOptions addField(Field field) {\n\t\tAssert.notNull(field, \"Field must not be null!\");\n\t\tthis.fields.add(field);\n\t\treturn this;\n\t}", "role": "assistant" } ]
[ { "content": "Add name of field to highlight on\n\n@param fieldname\n@return", "role": "user" }, { "content": "public HighlightOptions addField(String fieldname) {\n\t\tAssert.hasText(fieldname, \"Fieldname must not be null nor empty!\");\n\t\treturn addField(new SimpleField(fieldname));\n\t}", ...
[ { "content": "Add parameter by name\n\n@param parameterName must not be null\n@param value\n@return", "role": "user" }, { "content": "public HighlightOptions addHighlightParameter(String parameterName, Object value) {\n\t\treturn addHighlightParameter(new HighlightParameter(parameterName, value));\n...
[ { "content": "Get Collection of fields that have field specific highlight options.\n\n@return", "role": "user" }, { "content": "public Collection<FieldWithHighlightParameters> getFieldsWithHighlightParameters() {\n\n\t\tList<FieldWithHighlightParameters> result = new ArrayList<>();\n\t\tfor (Field c...
[ { "content": "Convert given object into target type\n\n@param source\n@param targetType\n@return", "role": "user" }, { "content": "@Nullable\n\tprotected <T> T convert(Object source, Class<T> targetType) {\n\t\treturn this.conversionService.convert(source, targetType);\n\t}", "role": "assistant"...
[ { "content": "add a query parameter\n\n@param queryParameter must not be null", "role": "user" }, { "content": "public void add(T queryParameter) {\n\t\tAssert.notNull(queryParameter, \"QueryParameter must not be null!\");\n\t\tthis.parameters.put(queryParameter.getName(), queryParameter);\n\t}", ...
[ { "content": "Append additional field for faceting\n\n@param field\n@return", "role": "user" }, { "content": "public final FacetOptions addFacetOnField(Field field) {\n\t\tAssert.notNull(field, \"Cannot facet on null field.\");\n\t\tAssert.hasText(field.getName(), \"Cannot facet on field with null/e...
[ { "content": "Append additional field for range faceting\n\n@param field the {@link Field} to be appended to range faceting fields\n@return this\n@since 1.5", "role": "user" }, { "content": "public final FacetOptions addFacetByRange(FieldWithRangeParameters<?, ?, ?> field) {\n\t\tAssert.notNull(fiel...
[ { "content": "Append all fieldnames for faceting\n\n@param fieldnames\n@return", "role": "user" }, { "content": "public final FacetOptions addFacetOnFlieldnames(Collection<String> fieldnames) {\n\t\tAssert.notNull(fieldnames, \"Fieldnames must not be null!\");\n\n\t\tfor (String fieldname : fieldnam...
[ { "content": "Create the plain query string representation of the given node.\n\n@param node\n@return\n@deprecated since 4.0. Use {@link #createQueryStringFromNode(Node, int, Class)} instead.", "role": "user" }, { "content": "@Deprecated\n\tpublic String createQueryStringFromNode(Node node, int posi...
[ { "content": "Add an criteria to the query. The criteria will be connected using 'AND'.\n\n@param criteria must not be {@literal null}.\n@return", "role": "user" }, { "content": "@SuppressWarnings(\"unchecked\")\n\tpublic final <T extends SolrDataQuery> T addCriteria(Criteria criteria) {\n\n\t\tAsse...
[ { "content": "Customization hook for clean up operations", "role": "user" }, { "content": "protected void doClose() {\n\t\tthis.delegate = Collections.<T> emptyList().iterator();\n\t\tthis.referenceQuery.clear();\n\t\tthis.position = -1;\n\t\tthis.cursorMark = null;\n\t}", "role": "assistant" ...
[ { "content": "Build up an exclusion set\n\n@param excludedArtifacts List of artifact coords patterns in the format <groupId>:<artifactId>[:<extension>][:<classifier>]\n@return Set<Exclusion>\n@throws MojoExecutionException if any patterns are invalid", "role": "user" }, { "content": "public static S...
[ { "content": "Convert an exclusion pattern into an Exclusion object\n\n@param exceptionPattern coords pattern in the format <groupId>:<artifactId>[:<extension>][:<classifier>]\n@return Exclusion object\n@throws MojoExecutionException if coords pattern is invalid", "role": "user" }, { "content": "sta...
[ { "content": "Check that an artifact is not excluded\n\n@param exclusions Collection of exclusions\n@param artifact Specific artifact to search through collection for\n@return boolean", "role": "user" }, { "content": "public static boolean artifactIsNotExcluded(Collection<Exclusion> exclusions, Ar...
[ { "content": "Create a default Array of JMeter artifact coordinates\n\n@param jmeterVersion JMeter version for artifacts\n@return List<String> of artifact coords", "role": "user" }, { "content": "public static List<String> createDefaultJmeterArtifactsArray(String jmeterVersion) {\n List<Strin...
[ { "content": "Check to see if a specified artifact is the same version, or a newer version that the comparative artifact\n\n@param artifact An artifact\n@param comparisonArtifact another Artifact to compare with.\n@return true if artifact is the same or a higher version. False if the artifact is a lo...
[ { "content": "Configure a local instance of JMeter\n\n@throws MojoExecutionException Exception", "role": "user" }, { "content": "@Override\n public void doExecute() throws MojoExecutionException {\n getLog().info(\" \");\n getLog().info(LINE_SEPARATOR);\n getLog().info(\"C O ...
[ { "content": "Generate the directory tree utilised by JMeter.", "role": "user" }, { "content": "private void generateJMeterDirectoryTree() {\n File workingDirectory = new File(jmeterDirectory, \"bin\");\n workingDirectory.mkdirs();\n JMeterConfigurationHolder.getInstance().setWo...
[ { "content": "This sets the default list of artifacts that we use to set up a local instance of JMeter.\nWe only use this default list if &lt;jmeterArtifacts&gt; has not been overridden in the POM.", "role": "user" }, { "content": "private void configureJMeterArtifacts() {\n if (jmeterArtifac...