Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someome please write the init method please This interface defines the following methods. void init(String filePath, String fileName); This method should deserialize the data

can someome please write the init method please

image text in transcribed

This interface defines the following methods. void init(String filePath, String fileName); This method should deserialize the data stored at the supplied filePath + fileName location into a list of Linkedln users. If there is no previously saved data, then this method should initialize a new list of Linkedln users. Depending on how you implement this method, you may find that the other methods defined on this interface may need access to the supplied filePath, fileName, and to the list of Linkedln users that is created by this method. If that is the case, then it is recommended that you set these values as properties on the implementing class. See the SerializedUserRepository code snippet below for an example on setting these values as properties of the class. void add(LinkedinUser user) throws LinkedinException; This method ensures that the supplied user is ready to be added to the user repository and, if so, adds the user to the list of users established from the init method. If the user name and user type are not supplied, throw a new LinkedInException with the message, "The user name and type are required to add a new user." Valid user types are either ' P ' for premier or ' S ' for standard. If the user type is invalid, throw a new LinkedlnException with the message, "Invalid user type. Valid types are P or S." If the supplied user already exists, throw a new LinkedInException with the message, "A user already exists with that user name." If the supplied user is ready to be added, add it to the list and call the saveAll() method to save the data

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions