package com.continuuity.passport.core;

import com.google.common.collect.ImmutableSet;

import java.util.Collections;
import java.util.HashSet;
import java.util.Set;

/**
 * Defines Components in the system.
 */
public class Component {

  public enum ComponentType { DATASET, VPC}
  private String name;
  private ComponentType componentType;
  private String id;
  private Set<ComponentACL> acls = new HashSet<ComponentACL>();

  public void setComponentType(ComponentType c) {
    this.componentType = componentType;
  }

  public void setName(String name) {
    this.name = name;
  }

  public void setId(String id) {
    this.id = id;
  }

  /**
   * getACLs for the component
   * @return ImmutableSet of ComponentACL
   */
  public ImmutableSet<ComponentACL> getComponentACLs() {
    return ImmutableSet.copyOf(this.acls);
  }

  public void addComponentAcl(ComponentACL acl) {
    this.acls.add(acl);

  }

}

@@ -245,25 +245,16 @@
 ic enum 
-Component
 Type %7B D
@@ -299,25 +299,16 @@
 private 
-Component
 Type com
@@ -414,24 +414,16 @@
  public 
-void set
 Componen
@@ -427,31 +427,84 @@
 nent
-Type(ComponentType c) %7B
+(String name, String id, Type type)%7B%0A    this.name = name;%0A    this.id = id;
 %0A   
@@ -525,26 +525,17 @@
 tType = 
-componentT
+t
 ype;%0A  %7D
@@ -549,55 +549,107 @@
 lic 
-void setName(String name) %7B%0A    this.name = nam
+String getName() %7B%0A    return name;%0A  %7D%0A%0A  public Type getComponentType() %7B%0A    return componentTyp
 e;%0A 
@@ -665,36 +665,29 @@
 lic 
-void setId(
 String 
-id
+getId(
 ) %7B%0A    
 this
@@ -678,33 +678,30 @@
 tId() %7B%0A    
-this.id =
+return
  id;%0A  %7D%0A%0A  

Refactor component