/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE @UMPLE_VERSION@ modeling language!*/

package example;

public class Mentor
{

  //------------------------
  // MEMBER VARIABLES
  //------------------------

  //Mentor Attributes
  private String name;
  private String id;

  //Mentor Associations
  private Student student;

  //------------------------
  // CONSTRUCTOR
  //------------------------

  public Mentor(String aName, Student aStudent)
  {
    name = aName;
    id = null;
    if (aStudent == null || aStudent.getMentor() != null)
    {
      throw new RuntimeException("Unable to create Mentor due to aStudent. See https://manual.umple.org?RE002ViolationofAssociationMultiplicity.html");
    }
    student = aStudent;
  }

  public Mentor(String aName, String aNameForStudent, int aNumberForStudent)
  {
    name = aName;
    id = null;
    student = new Student(aNameForStudent, aNumberForStudent, this);
  }

  //------------------------
  // INTERFACE
  //------------------------

  public boolean setName(String aName)
  {
    boolean wasSet = false;
    name = aName;
    wasSet = true;
    return wasSet;
  }

  public boolean setId(String aId)
  {
    boolean wasSet = false;
    id = aId;
    wasSet = true;
    return wasSet;
  }

  public String getName()
  {
    return name;
  }

  public String getId()
  {
    return id;
  }

  public Student getStudent()
  {
    return student;
  }

  public void delete()
  {
    Student existingStudent = student;
    student = null;
    if (existingStudent != null)
    {
      existingStudent.delete();
    }
  }


  public String toString()
  {
    return super.toString() + "["+
            "name" + ":" + getName()+ "," +
            "id" + ":" + getId()+ "]" + System.getProperties().getProperty("line.separator") +
            "  " + "student = "+(getStudent()!=null?Integer.toHexString(System.identityHashCode(getStudent())):"null");
  }
}
