Package me.fami6xx.rpuniverse.core.jobs
Class Position
java.lang.Object
me.fami6xx.rpuniverse.core.jobs.Position
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PositionfromString(String s)Constructs a Position object from a string representation.getName()Getter method for namedoubleGetter method for salaryintGetter method for working step permission levelbooleanisBoss()Getter method for isBossbooleanGetter method for isDefaultvoidsetBoss(boolean boss)Setter method for isBossvoidsetDefault(boolean aDefault)Setter method for isDefaultvoidSetter method for namevoidsetSalary(double salary)Setter method for salaryvoidsetWorkingStepPermissionLevel(int workingStepPermissionLevel)Setter method for working step permission leveltoString()Returns a string representation of the Position object.
-
Constructor Details
-
Position
public Position(String name, double salary, int workingStepPermissionLevel, boolean isBoss, boolean isDefault)Position full-argument constructor- Parameters:
name- Name of the positionsalary- Salary of the positionworkingStepPermissionLevel- Working step permission level of the positionisBoss- Boolean flag if position is a bossisDefault- Boolean flag if position is default
-
-
Method Details
-
getName
Getter method for name- Returns:
- Name of the position
-
setName
Setter method for name- Parameters:
name- New name of the position
-
getSalary
public double getSalary()Getter method for salary- Returns:
- Salary of the position
-
setSalary
public void setSalary(double salary)Setter method for salary- Parameters:
salary- New salary of the position
-
getWorkingStepPermissionLevel
public int getWorkingStepPermissionLevel()Getter method for working step permission level- Returns:
- Working step permission level of the position
-
setWorkingStepPermissionLevel
public void setWorkingStepPermissionLevel(int workingStepPermissionLevel)Setter method for working step permission level- Parameters:
workingStepPermissionLevel- New working step permission level of the position
-
isBoss
public boolean isBoss()Getter method for isBoss- Returns:
- If the position is a boss position
-
setBoss
public void setBoss(boolean boss)Setter method for isBoss- Parameters:
boss- If the position is a boss position
-
isDefault
public boolean isDefault()Getter method for isDefault- Returns:
- If the position is a default position
-
setDefault
public void setDefault(boolean aDefault)Setter method for isDefault- Parameters:
aDefault- If the position is a default position
-
toString
Returns a string representation of the Position object. -
fromString
Constructs a Position object from a string representation.- Parameters:
s- The string representation of the Position object. The string should be in the format "{key1=value1, key2=value2, ...}". The following keys are expected: - name: Name of the position (String) - salary: Salary of the position (int) - workingStepPermissionLevel: Working step permission level of the position (int) - isBoss: Boolean flag if position is a boss (boolean) - isDefault: Boolean flag if position is default (boolean)- Returns:
- A Position object created from the given string representation, or null if any error occurred during the conversion.
-