id.ac.unpar.siamodels.MataKuliah Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SIAModels Show documentation
Show all versions of SIAModels Show documentation
This library models various aspects of Universitas Katolik Parahyangan's
objects, such as mahasiswa (student), their modules, and their grades.
Theoretically supports all departments, but only Informatics department
is mostly complete.
package id.ac.unpar.siamodels;
import java.io.Serializable;
public abstract class MataKuliah implements Serializable {
private final String kode;
private final String nama;
private final Integer sks;
public MataKuliah() {
this.kode = this.getClass().getSimpleName();
if (this.getClass().isAnnotationPresent(InfoMataKuliah.class)) {
InfoMataKuliah infoMK = (InfoMataKuliah) this.getClass().getAnnotation(InfoMataKuliah.class);
this.nama = infoMK.nama();
this.sks = infoMK.sks();
} else {
this.nama = null;
this.sks = null;
}
}
public MataKuliah(String kode, String nama, int sks) {
this.kode = kode;
this.nama = nama;
this.sks = sks;
}
public String getKode() {
return kode;
}
public String getNama() {
return nama;
}
public Integer getSks() {
return sks;
}
@Override
public String toString() {
return "{" + "kode=" + kode + ", nama=" + nama + ", sks=" + sks + '}';
}
}