47 lines
905 B
Java
Executable File
47 lines
905 B
Java
Executable File
package com.plannaplan.responses.models.abstracts;
|
|
|
|
import com.plannaplan.entities.Course;
|
|
|
|
/**
|
|
* Course entity api response
|
|
*/
|
|
public abstract class CoursesResponse {
|
|
|
|
private Long id;
|
|
private String name;
|
|
private String symbol;
|
|
|
|
/**
|
|
* create instance
|
|
*
|
|
* @param course entity to map to api response
|
|
*/
|
|
public CoursesResponse(Course course) {
|
|
this.id = course.getId() != null ? course.getId() : null;
|
|
this.name = course.getName() != null ? course.getName() : "";
|
|
this.symbol = course.getSymbol() != null ? course.getSymbol() : "";
|
|
}
|
|
|
|
/**
|
|
* @return course name
|
|
*/
|
|
public String getName() {
|
|
return name;
|
|
}
|
|
|
|
/**
|
|
* @return course symbol
|
|
*/
|
|
public String getSymbol() {
|
|
return symbol;
|
|
}
|
|
|
|
/**
|
|
* @return db id
|
|
*/
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
}
|