/*
 * 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 web.component.impl.awselb.model;

import web.component.api.model.Subnet;

/**
 *
 * @author Hiroshi
 */
public class SubnetImpl implements Subnet{

    private final String id;
    
    private SubnetImpl(String id){
        this.id = id;
    }
    
    @Override
    public String getId() {
        return id;
    }
    
    public static Subnet create(String id){
        return new SubnetImpl(id);
    }
    
    @Override
    public boolean equals(Object toBeCompared){
        if(toBeCompared instanceof SubnetImpl)
            return this.getId().equals(((SubnetImpl)toBeCompared).getId());
        return false;
    }
    
    @Override
    public int hashCode(){
        //this is wrong, but don't know how to implement this method properly.
        return 31 * this.getId().hashCode();
    }
    
    @Override
    public String toString(){
        return "{SubnetID: " + id + "}";
    }
}

@@ -319,61 +319,75 @@
 mpl 
-implements Subnet%7B%0A%0A    private final String id;%0A    
+extends com.amazonaws.services.ec2.model.Subnet implements Subnet%7B%0A
 %0A   
@@ -430,20 +430,29 @@
     
-this.id = 
+super.setSubnetId(
 id
+)
 ;%0A  
@@ -517,18 +517,35 @@
  return 
-id
+super.getSubnetId()
 ;%0A    %7D%0A
@@ -1112,16 +1112,175 @@
 %22 + 
-id + %22%7D%22
+getId() + %22%7D%22;%0A    %7D%0A    %0A    @Override%0A    public void setSubnetId(String subnetId)%7B%0A        throw new UnsupportedOperationException(%22Subnet id can not be modified.%22)
 ;%0A  

modify SubnetImpl class.