Advertisement
binibiningtinamoran

Supplier

Nov 11th, 2019
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.48 KB | None | 0 0
  1. public class Supplier {
  2.  
  3.     private int supplierId;
  4.     private String companyName;
  5.     private String contactName;
  6.     private final static String DEFAULT_CONTACT_NAME = "NO NAME ENTERED";
  7.  
  8.     public Supplier() {
  9.  
  10.     }
  11.  
  12.     public Supplier(int supplierId, String companyName, String contactName) {
  13.         this(supplierId, companyName);
  14.         this.contactName = contactName;
  15.         /*this.supplierId = supplierId;
  16.         this.companyName = companyName;
  17.         this.contactName = contactName;
  18.        
  19.          */
  20.     }
  21.  
  22.     public Supplier(int supplierId, String companyName) {
  23.         this.supplierId = supplierId;
  24.         this.companyName = companyName;
  25.         this.contactName = DEFAULT_CONTACT_NAME;
  26.     }
  27.  
  28.     public int getSupplierId() {
  29.         return supplierId;
  30.     }
  31.  
  32.     public void setSupplierId(int supplierId) {
  33.         this.supplierId = supplierId;
  34.     }
  35.  
  36.     public String getCompanyName() {
  37.         return companyName;
  38.     }
  39.  
  40.     public void setCompanyName(String companyName) {
  41.         this.companyName = companyName;
  42.     }
  43.  
  44.     public String getContactName() {
  45.         return contactName;
  46.     }
  47.  
  48.     public void setContactName(String contactName) {
  49.         this.contactName = contactName;
  50.     }
  51.  
  52.     @Override
  53.     public String toString() {
  54.         return "Supplier\n" +
  55.                 "Supplier Id = "+ supplierId +
  56.                 "\nCompany Name: " + companyName +
  57.                 "\nContact Name: " + contactName;
  58.     }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement