Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class AirEventInput {
- private Long id;
- private String eventName;
- private Long startDate;
- private Long endDate;
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public String getEventName() {
- return eventName;
- }
- public void setEventName(String eventName) {
- this.eventName = eventName;
- }
- public Long getStartDate() {
- return startDate;
- }
- public void setStartDate(Long startDate) {
- this.startDate = startDate;
- }
- public Long getEndDate() {
- return endDate;
- }
- public void setEndDate(Long endDate) {
- this.endDate = endDate;
- }
- public class AirEventAPI {
- private Long id;
- private String eventName;
- private Long startDate;
- private Long endDate;
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public String getEventName() {
- return eventName;
- }
- public void setEventName(String eventName) {
- this.eventName = eventName;
- }
- public Long getStartDate() {
- return startDate;
- }
- public void setStartDate(Long startDate) {
- this.startDate = startDate;
- }
- public Long getEndDate() {
- return endDate;
- }
- public void setEndDate(Long endDate) {
- this.endDate = endDate;
- }
- public EventAPI mergeTwoEvents(EventInput eventInput, EventAPI eventAPI){
- ModelMapper modelMapper = new ModelMapper();
- modelMapper.createTypeMap(EventInput.class, EventAPI.class)
- .addMappings((mapper) -> mapper.skip(AirEventAPI::setStartDate));
- .setCondition(Conditions.isNotNull());
- modelMapper.map(eventInput, eventAPI);
- return eventAPI;
- }
Add Comment
Please, Sign In to add comment