Specifications:: Class Class
Specifications:: Class Class
Specifications:: Class Class
Your task here is to implement a Java code based on the following specifications.
Note that your code should match the specifications in a precise manner. Consider
default visibility of classes, data fields and methods unless mentioned otherwise.
Specifications:
class definitions:
class Employee:
data fields:
name: String
salary: int
Implement a Constructor using the class variables.
Implement getter setter methods with public visibility.
class EmployeeInfo:
enum definition:
named constants: BYNAME
BYSALARY
method definitions:
sort(List<Employee> emps, final SortMethod method): Method to
return sorted list by name and by salary using SortMethod
Return type: List<Employee>
Visibility: public
isCharacterPresentInAllNames(Collection<Employee> entities,
String character): method to check if Employee list contains a name
starting with a specific character
Return type: boolean
Visibility: public
Task:
String name;
int salary;
Define parameterized constructor.
Define getter method for all instance variables with public visibility.
(getName(),...)
Define setter methods for all instance variables with public visibility.
(setName(),....)
Create an EmployeeInfo class which performs following operations (as per the given
requirements) using StreamAPI:
enum SortMethod : representing a group of named
constants BYNAME and BYSALARY
sort(List<Employee> emps, final SortMethod method): Method to return
sorted list by name and by salary using SortMethod
isCharacterPresentInAllNames(Collection<Employee> entities, String
character): Method to check if Employee list contains a name starting with a
specific character
Sample Input
Sample Output
NOTE