/*PLEASE DO NOT EDIT THIS CODE*/ /*This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language!*/ package example; // line 3 "../UnidirectionalOptionalOneTest.ump" public class Mentor { //------------------------ // MEMBER VARIABLES //------------------------ //Mentor Attributes private String name; //Mentor Associations private Student student; //------------------------ // CONSTRUCTOR //------------------------ public Mentor(String aName) { name = aName; } //------------------------ // INTERFACE //------------------------ public boolean setName(String aName) { boolean wasSet = false; name = aName; wasSet = true; return wasSet; } public String getName() { return name; } /* Code from template association_GetOne */ public Student getStudent() { return student; } public boolean hasStudent() { boolean has = student != null; return has; } /* Code from template association_SetUnidirectionalOptionalOne */ public boolean setStudent(Student aNewStudent) { boolean wasSet = false; student = aNewStudent; wasSet = true; return wasSet; } public void delete() { student = null; } public String toString() { return super.toString() + "["+ "name" + ":" + getName()+ "]" + System.getProperties().getProperty("line.separator") + " " + "student = "+(getStudent()!=null?Integer.toHexString(System.identityHashCode(getStudent())):"null"); } } /*PLEASE DO NOT EDIT THIS CODE*/ /*This code was generated using the UMPLE 1.35.0.7523.c616a4dce modeling language!*/ package example; // line 9 "../UnidirectionalOptionalOneTest.ump" public class Student { //------------------------ // MEMBER VARIABLES //------------------------ //Student Attributes private String number; //------------------------ // CONSTRUCTOR //------------------------ public Student(String aNumber) { number = aNumber; } //------------------------ // INTERFACE //------------------------ public boolean setNumber(String aNumber) { boolean wasSet = false; number = aNumber; wasSet = true; return wasSet; } public String getNumber() { return number; } public void delete() {} public String toString() { return super.toString() + "["+ "number" + ":" + getNumber()+ "]"; } }