Class Position

java.lang.Object
me.fami6xx.rpuniverse.core.jobs.Position

public class Position extends 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 position
      salary - Salary of the position
      workingStepPermissionLevel - Working step permission level of the position
      isBoss - Boolean flag if position is a boss
      isDefault - Boolean flag if position is default
  • Method Details

    • getName

      public String getName()
      Getter method for name
      Returns:
      Name of the position
    • setName

      public void setName(String name)
      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

      public String toString()
      Returns a string representation of the Position object.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the Position object, including the name, salary, working step permission level, boss flag, and default flag.
    • fromString

      public static Position fromString(String s)
      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.