Created
February 18, 2022 09:31
-
-
Save maneeshaindrachapa/dab4d0be4308ff21d545c33188ce8119 to your computer and use it in GitHub Desktop.
TourPackage - Tour California Application
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.explore.california.model; | |
import javax.persistence.Column; | |
import javax.persistence.Entity; | |
import javax.persistence.Id; | |
import java.util.Objects; | |
@Entity | |
public class TourPackage { | |
@Id | |
private String code; | |
@Column | |
private String name; | |
protected TourPackage() { | |
} | |
public TourPackage(String code, String name) { | |
this.code = code; | |
this.name = name; | |
} | |
public String getCode() { | |
return code; | |
} | |
public String getName() { | |
return name; | |
} | |
@Override | |
public String toString() { | |
return "TourPackage{" + | |
"code='" + code + '\'' + | |
", name='" + name + '\'' + | |
'}'; | |
} | |
@Override | |
public boolean equals(Object o) { | |
if (this == o) return true; | |
if (o == null || getClass() != o.getClass()) return false; | |
TourPackage that = (TourPackage) o; | |
return Objects.equals(code, that.code) && | |
Objects.equals(name, that.name); | |
} | |
@Override | |
public int hashCode() { | |
return Objects.hash(code, name); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment