{"id":23055652,"url":"https://github.com/intellisrc/groovy-extend","last_synced_at":"2025-04-03T05:17:59.373Z","repository":{"id":113597744,"uuid":"455413360","full_name":"Intellisrc/groovy-extend","owner":"Intellisrc","description":"Extension to standard classes using groovy to simplify code","archived":false,"fork":false,"pushed_at":"2023-11-28T03:12:25.000Z","size":511,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2023-11-29T02:28:06.584Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Intellisrc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-02-04T03:48:23.000Z","updated_at":"2024-04-15T08:42:57.624Z","dependencies_parsed_at":"2024-04-15T08:54:35.155Z","dependency_job_id":null,"html_url":"https://github.com/Intellisrc/groovy-extend","commit_stats":null,"previous_names":[],"tags_count":1,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellisrc%2Fgroovy-extend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellisrc%2Fgroovy-extend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellisrc%2Fgroovy-extend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Intellisrc%2Fgroovy-extend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Intellisrc","download_url":"https://codeload.github.com/Intellisrc/groovy-extend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246939222,"owners_count":20857922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-16T01:12:54.271Z","updated_at":"2025-04-03T05:17:59.355Z","avatar_url":"https://github.com/Intellisrc.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\nThis project is to extend (Java/Groovy) core classes to improve productivity.\n\n# Usage\nHow to use it in your project:\n\nMaven:\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.intellisrc\u003c/groupId\u003e\n  \u003cartifactId\u003egroovy-extend\u003c/artifactId\u003e\n  \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\nGradle:\n```groovy\ndependecies {\n    implementation 'com.intellisrc:groovy-extend:VERSION'\n    // or extended annotation:\n    implementation group: 'com.intellisrc', name: 'groovy-extend', version: 'VERSION'\n}\n```\nIn which `VERSION` is this package version, for example: `4.0.23.14`. \nThe first 3 numbers (4.0.23) are Groovy version used to compile this package. \nYou can use the groovy version that fits your needs.\n\n**NOTE**: Don't forget to add your groovy dependency.\n\n# Extensions\n\n## Date \u0026 Time\n\n`Date` class should no longer be used. Because of that, we extended `Date` class to make it easier to change it to `LocalDate` and `LocalDateTime`:\n\n### Date Methods\n\n* `toLocalDateTime`\n* `toLocalDate`\n* `toLocalTime`\n* `toZonedDateTime`\n\n### LocalDate / LocalDateTime / LocalTime / ZonedDateTime Methods\n\n* `toDate` : Only used for external codes which still rely on Date\n* `toDateTime` : Convert to DateTime\n* `format` : use DateTimeFormatter in an easy way\n* `isBetween` : Check if date or time is between two other dates or times\n* `atStartOfDay` : Added to LocalDate as well\n* `atEndOfDay` : get the last nanosecond of the day\n\n#### LocalDateTime / ZonedDateTime\n* `YMDHms` : Return \"yyyy-MM-dd HH:mm:ss\"\n* `getYMDHms(\"\",\"\")` : Return \"yyyyMMddHHmmss\"\n* `YMDHmsS` : Return \"yyyy-MM-dd HH:mm:ss.SSS\"\n* `YMDHm` : Return \"yyyy-MM-dd HH:mm\"\n* `toMillis` : Return epoch milliseconds (long)\n* `fromMillis` : (static) Convert epoch milliseconds into LocalDateTime\n* `toSeconds` : Return epoch seconds (long)\n* `fromSeconds` : (static) Convert epoch seconds into LocalDateTime\n\n#### LocalDateTime only:\n* `clearTime` : Return a LocalDateTime with 00:00:00.000 time\n\n#### LocalDate / ZonedDateTime:\n* `YMD` : Return \"yyyy-MM-dd\"\n\n#### LocalDate only:\n* `YY` : Return \"yy\"\n* `MM` : Return \"MM\"\n* `DD` : Return \"dd\"\n* `next()` and `previous()` : Allows to use it as range: (from..to)\n\n#### LocalTime only:\n* `HHmmss` : Return \"HH:mm:ss\"\n* `getHHmmss(\"\")` : Return \"HHmmss\"\n* `HHmm` : Return \"HH:mm\"\n\n## Files\n\nThese extensions provide faster ways to deal with files. Setting permissions and performing operations are made easier.\n\n### File Methods\n\n#### Locating\n\n* `get` : Similar to `new File()` but more flexible.\n* `create` : Similar to `get()` but will create an empty file including their directories\n* `userDir` : get User directory (root directory for project)\n* `homeDir` : get Home directory\n* `tempDir` : get the temporal directory\n\n#### Performance\n\n* `lines` : Get total lines in a file (faster way)\n* `eachFileAsync` : Iterate through all files without having to read the whole directory first\n* `eachFileMatchAsync` : Iterate files inside directory using glob search or FileFilter\n* `listFiles` : Using glob search (Async) [`@since 2.5.6.2`]\n* `deleteFiles` : Delete files using glob search or FileFilter (Async) [`@since 2.5.6.2`]\n\n#### Permissions\n\n* `permissions` : Will return PosixFilePermissions\n* `ownerPermissions` : set owner permissions\n* `groupPermissions` : set group permissions\n* `othersPermissions` : set others permissions\n* `clearPermissions`\n* `clearOwnerPermissions`\n* `clearGroupPermissions`\n* `clearOthersPermissions`\n* `setReadable`\n* `setWritable`\n* `setExecutable`\n* `setOwnerReadable`\n* `setOwnerWritable`\n* `setOwnerExecutable`\n* `setGroupReadable`\n* `setGroupWritable`\n* `setGroupExecutable`\n* `setOthersReadable`\n* `setOthersWritable`\n* `setOthersExecutable`\n\n#### Operations\n\n* `copyTo`\n* `moveTo`\n* `linkTo`           : Create a link from a file. Its argument is the link to create. An additional argument is to specify if link is hard or not.\n* `hardLinkOrCopyTo` : Will try to create a hardLink, but if its in another device (which is not allowed), it will copy it.\n\n### String\n\nExtends String methods that are commonly used and easiest ways to convert them.\n\n* `alphaNumeric` : returns only alphanumeric characters\n* `padRight` : pad to the right with spaces\n* `padLeft` : pad to the left with spaces\n* `appendRandomNum` : Useful to create random strings, e.g: 'apple1234'\n* `insertAt` : Insert a substring into a string in a specific position\n\n#### Conversion\n\n* `toInet4Address`\n* `toInet6Address`\n* `toInetAddress`\n* `getQueryMap` : Convert Query String to Map\n* `toDateTime`  : Convert String into LocalDateTime (auto detect format)\n* `toDate`      : Convert String into LocalDate (auto detect format)\n* `toTime`      : Convert String into LocalTime (auto detect format)\n* `toSnakeCase` : Returns a string as snake_case_formatted_string\n* `toCamelCase` : Returns a string as CamelCaseFormattedString\n* `toDotCase`   : Returns a string as dot.case.formatted.string\n* `toKebabCase` : Returns a string as Kebab-Case-Formatted-String\n\n#### BigDecimal\n\n* `ceil`\n* `floor`\n\n## Other\n\n### Map Methods\n\n* `toQueryString` : Convert Map to Query String e.g : \"a=1\u0026b=2\"\n\n### Random Methods\n\n* `range` : Specify a range to get a random number\n\n### Collection Methods\n\n* `random` : Get one or more random element from a collection (two implementations).\n\n### Additional Classes\n\n* `LimitedLinkedList` : A list with a limited number of elements\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintellisrc%2Fgroovy-extend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintellisrc%2Fgroovy-extend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintellisrc%2Fgroovy-extend/lists"}