Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package eksam2018;
- import org.codehaus.jackson.annotate.JsonCreator;
- import org.codehaus.jackson.annotate.JsonProperty;
- import org.codehaus.jackson.annotate.JsonPropertyOrder;
- /**
- *
- * @author t166038
- */
- @JsonPropertyOrder({
- "id",
- "Nimetus",
- "Tootja",
- "Hind"
- })
- public class Goods implements java.io.Serializable{
- @JsonProperty("id")
- private Long id;
- @JsonProperty("Nimetus")
- private String nimetus;
- @JsonProperty("Tootja")
- private String tootja;
- @JsonProperty("Hind")
- private Double hind; // valjad
- @JsonCreator
- public Goods(Long id, String nimetus, String tootja, Double hind) {
- this.id = id;
- this.nimetus = nimetus;
- this.tootja = tootja;
- this.hind = hind; // konstruktor
- }
- public Goods() {
- }
- public Long getId() { // get/set meetodid
- return id;
- }
- public String getNimetus() {
- return nimetus;
- }
- public String getTootja() {
- return tootja;
- }
- public Double getHind() {
- return hind;
- }
- public void setId(Long id) {
- this.id = id;
- }
- public void setNimetus(String nimetus) {
- this.nimetus = nimetus;
- }
- public void setTootja(String tootja) {
- this.tootja = tootja;
- }
- public void setHind(Double hind) {
- this.hind = hind;
- }
- @Override
- public String toString() { // uus toString meetod
- return "\n{\"ID\":"+id+", \"Nimetus\":\""+nimetus+"\", \"Tootja\":\""+tootja+"\", \"Hind\":\""+hind+"}";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement