Advertisement
Martupi8

class Camara

Mar 8th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.26 KB | None | 0 0
  1. package ejercicios;
  2.  
  3. public class Camara {
  4.     private String camara;
  5.  
  6.     public String getCamara() {
  7.         return camara;
  8.     }
  9.  
  10.     public void setCamara(String camara) {
  11.         this.camara = camara;
  12.     }
  13.  
  14.     public static Camara ofCamara(String camara){
  15.         return new Camara(camara);
  16.     }
  17.    
  18.     public Camara(String camara) {
  19.         super();
  20.         this.camara = camara;
  21.     }
  22.    
  23.     public Camara(String[] formato) {
  24.         super();
  25.         this.camara = formato[0];
  26.     }
  27.    
  28.     public Camara() {
  29.         this.camara=null;
  30.     }
  31.    
  32.     public static Camara of() {
  33.         return new Camara("");
  34.     }
  35.    
  36.     public static Camara ofFormat(String[] formato) {
  37.         return new Camara(formato);
  38.     }
  39.    
  40.     @Override
  41.     public int hashCode() {
  42.         final int prime = 31;
  43.         int result = 1;
  44.         result = prime * result + ((camara == null) ? 0 : camara.hashCode());
  45.         return result;
  46.     }
  47.  
  48.     @Override
  49.     public boolean equals(Object obj) {
  50.         if (this == obj)
  51.             return true;
  52.         if (obj == null)
  53.             return false;
  54.         if (getClass() != obj.getClass())
  55.             return false;
  56.         Camara other = (Camara) obj;
  57.         if (camara == null) {
  58.             if (other.camara != null)
  59.                 return false;
  60.         } else if (!camara.equals(other.camara))
  61.             return false;
  62.         return true;
  63.     }
  64.  
  65.     @Override
  66.     public String toString() {
  67.         return "Camara [camara=" + camara + "]";
  68.     }
  69.    
  70.    
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement