xt4k

Untitled

Apr 2nd, 2021
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. package app.helper.pojo.api.csb.deck;
  2.  
  3. import app.utils.CommonOperations;
  4. import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
  5. import com.fasterxml.jackson.annotation.JsonProperty;
  6.  
  7. import java.util.UUID;
  8.  
  9. import static app.helper.model.BaseTest.vesselId;
  10. import static app.utils.Enums.TextFields.AUTODECK;
  11. import static app.utils.Enums.TextFields.AUTOTESTDECKNAME;
  12.  
  13. @JsonIgnoreProperties(ignoreUnknown = true)
  14. public class Deck{
  15.  
  16. @JsonProperty("IsPassive")
  17. private boolean isPassive;
  18.  
  19. @JsonProperty("VesselId")
  20. private int id;
  21.  
  22. @JsonProperty("Code")
  23. private String code;
  24.  
  25. @JsonProperty("Name")
  26. private String name;
  27.  
  28. public Deck() {
  29. CommonOperations co = new CommonOperations();
  30. this.isPassive = false;
  31. this.id = vesselId;
  32. this.code = AUTODECK.gV()+co.getRandomNumber(6);
  33. this.name = AUTOTESTDECKNAME.gV( )+ UUID.randomUUID().toString().toUpperCase();
  34.  
  35. }
  36.  
  37. public Deck(Deck deck) {
  38. this.id = deck.getVesselId();
  39. this.isPassive = deck.getIsPassive();
  40. this.code = deck.getCode();
  41. this.name = deck.getName();
  42. }
  43.  
  44. @Override
  45. public String toString(){
  46. return
  47. "Deck { isPassive = '" + isPassive + '\'' +
  48. ",id = '" + id + '\'' +
  49. ",code = '" + code + '\'' +
  50. ",name = '" + name + "}";
  51. }
  52.  
  53.  
  54. public int getVesselId( ) { return id; }
  55.  
  56. public String getName( ) { return name; }
  57.  
  58. public String getCode( ) { return code; }
  59.  
  60. public boolean getIsPassive( ) { return isPassive; }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment