{"id":24021194,"url":"https://github.com/zipcodecore/maven.exceptionalphonenumbers","last_synced_at":"2025-04-15T21:16:23.363Z","repository":{"id":147837783,"uuid":"105725983","full_name":"ZipCodeCore/Maven.ExceptionalPhoneNumbers","owner":"ZipCodeCore","description":null,"archived":false,"fork":false,"pushed_at":"2019-11-12T17:59:12.000Z","size":53,"stargazers_count":1,"open_issues_count":41,"forks_count":159,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T21:16:14.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ZipCodeCore.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2017-10-04T02:49:44.000Z","updated_at":"2024-03-29T10:18:15.000Z","dependencies_parsed_at":"2023-04-06T06:47:12.703Z","dependency_job_id":null,"html_url":"https://github.com/ZipCodeCore/Maven.ExceptionalPhoneNumbers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMaven.ExceptionalPhoneNumbers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMaven.ExceptionalPhoneNumbers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMaven.ExceptionalPhoneNumbers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ZipCodeCore%2FMaven.ExceptionalPhoneNumbers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ZipCodeCore","download_url":"https://codeload.github.com/ZipCodeCore/Maven.ExceptionalPhoneNumbers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249153950,"owners_count":21221330,"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":"2025-01-08T12:39:52.201Z","updated_at":"2025-04-15T21:16:23.354Z","avatar_url":"https://github.com/ZipCodeCore.png","language":"Java","readme":"\n# Exceptional Phone Numbers\n\n\n# PhoneNumberFactory\n* **Purpose** - to demonstrate basic exception handling and logging.\n* **Objective** - to implement a `PhoneNumberFactory` class that generates `PhoneNumber` objects.\n* The `PhoneNumber` class is a container for a `String` representation of a respective phone number.\n* Note: Phone numbers are a composite of 3 affixes; `Area Code`, `Central Office Code`, and `Phone Line Code`.\n\t* `Area Code`  - the first 3 numeric values\n\t* `Central Office Code` - the 4th, 5th, and 6th numeric values.\n\t* `Phone Line Code` - the last 4 numeric values. \n\n* Below is a sample *instantation of* and *invokation on* `PhoneNumber`.\n\t\n```Java\nString stringRepresentation = \"(302)-312-5555\";\nPhoneNumber phoneNumber = new PhoneNumber(stringRepresentation);\nString areaCode = phoneNumber.getAreaCode();\nString centralOfficeCode = phoneNumber.getCentralOfficeCode();\nString phoneLineCode = phoneNumber.getPhoneLineCode();\n```\n\n\n# Part 1; Modify `createPhoneNumber`\n* Upon instantiating a new `PhoneNumber` object, it is possible to receive a `InvalidPhoneNumberFormatException` if the `String` passed into the `PhoneNumber` constructor does not fit the format `(###)-###-####`.\u003cbr\u003e\n* `InvalidPhoneNumberFormatException` extends `IOException`, which is a `checked exception`.\u003cbr\u003e\n* Modify the `createPhoneNumber` method so that it throws any resulting `InvalidPhoneNumberFormatException`.\n\t* This will ensure that any method calling `createPhoneNumber` will have to handle the exception.\n\n\n\n# Part 2; Implement `createPhoneNumberSafely`\n* Using the `createPhoneNumber` method from `Part 1`, define the `createPhoneNumberSafely` method such that the input parameters, `areaCode`, `centralOfficeCode`, `phoneLineCode` are concatenated to create a `String` representation of the respective phone number.\n* Use this `String` object to construct a new instance of `PhoneNumber` and return it.\n* If the concatentation of the input parameters yields a `String` whose value does not match the format `(###)-###-####`, then our `PhoneNumber` will throw a `InvalidPhoneNumberFormatException`.\n* If a `InvalidPhoneNumberFormatException` is thrown within this method, catch it and return `null`.\n\n\n# Part 3; Implement `createRandomPhoneNumber`\n* Using the `RandomNumberFactory`, generate a random `Area Code`, `Central Office Code`, and `Phone Line Code`. Pass these values as arguments of the `createPhoneNumberSafely` method from `Part 2` and return the resulting `PhoneNumber` object.\n\n\n# Part 4; Implement `createRandomPhoneNumberArray`\n* Using the `createRandomPhoneNumber` from `Part 3`, generate an array of `PhoneNumber` objects, whose length reflects the input argument.\n\t* For example `createRandomPhoneNumber(5)` should return an array of 5 `PhoneNumber` objects.\n\n\n# Part 5; Add logging\n* Add logging to the `createPhoneNumber` method from `Part 1`, which logs the message\n\t* `\"Attempting to create a new PhoneNumber object with a value of (###)-###-####`\n\t* where `(###)-###-####` will be replaced with the respective input parameter.\n\n* Add logging to the `createPhoneNumberSafely` method from `Part 2`, which logs the message\n\t* `(###)-###-#### is not a valid phone number`\n\t* Where `(###)-###-####` will be replaced with the respective input parameter.\n\n\t\n# Part 6; Ensure all test cases pass\n* Yeah this header says all that is needed...\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fmaven.exceptionalphonenumbers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzipcodecore%2Fmaven.exceptionalphonenumbers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzipcodecore%2Fmaven.exceptionalphonenumbers/lists"}