Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/robtimus/try-parse
Provides functionality to parse to Optional and its primitive versions
https://github.com/robtimus/try-parse
java optional optionals parse
Last synced: 3 days ago
JSON representation
Provides functionality to parse to Optional and its primitive versions
- Host: GitHub
- URL: https://github.com/robtimus/try-parse
- Owner: robtimus
- License: apache-2.0
- Created: 2019-04-28T11:34:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-20T12:51:54.000Z (10 months ago)
- Last Synced: 2024-01-20T13:39:58.095Z (10 months ago)
- Topics: java, optional, optionals, parse
- Language: Java
- Homepage: https://robtimus.github.io/try-parse/
- Size: 428 KB
- Stars: 1
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# try-parse
[![Maven Central](https://img.shields.io/maven-central/v/com.github.robtimus/try-parse)](https://search.maven.org/artifact/com.github.robtimus/try-parse)
[![Build Status](https://github.com/robtimus/try-parse/actions/workflows/build.yml/badge.svg)](https://github.com/robtimus/try-parse/actions/workflows/build.yml)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.github.robtimus%3Atry-parse&metric=alert_status)](https://sonarcloud.io/summary/overall?id=com.github.robtimus%3Atry-parse)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.github.robtimus%3Atry-parse&metric=coverage)](https://sonarcloud.io/summary/overall?id=com.github.robtimus%3Atry-parse)
[![Known Vulnerabilities](https://snyk.io/test/github/robtimus/try-parse/badge.svg)](https://snyk.io/test/github/robtimus/try-parse)Provides functionality to parse to [Optional](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html) and its primitive versions.
Currently there are five sets of methods:
* `TryParse.tryParseInt`: a copy of `Integer.parseInt` to parse to [OptionalInt](https://docs.oracle.com/javase/8/docs/api/java/util/OptionalInt.html) instead of throwing exceptions.
* `TryParse.tryParseUnsignedInt`: a copy of `Integer.parseUnsignedInt` to parse to [OptionalInt](https://docs.oracle.com/javase/8/docs/api/java/util/OptionalInt.html) instead of throwing exceptions.
* `TryParse.tryParseLong`: a copy of `Long.parseLong` to parse to [OptionalLong](https://docs.oracle.com/javase/8/docs/api/java/util/OptionalLong.html) instead of throwing exceptions.
* `TryParse.tryParseUnsignedLong`: a copy of `Long.parseUnsignedLong` to parse to [OptionalLong](https://docs.oracle.com/javase/8/docs/api/java/util/OptionalLong.html) instead of throwing exceptions.
* `TryParse.tryParseBoolean`: a copy of `Boolean.parseBoolean` to parse to [Optional](https://docs.oracle.com/javase/8/docs/api/java/util/Optional.html) instead of returning `false`.In addition, there are several methods that delegate to an existing method, catching expected exceptions. These are not as fast as the above five sets, but can still be useful.