@Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    ResourceImpl resource = (ResourceImpl) o;

    return type == resource.type &&
        !(propertiesMap != null ? !propertiesMap.equals(resource.propertiesMap) : resource.propertiesMap != null);
  }
Construct a resource from the given resource, setting only the properties
that are found in the given set of property and category ids.

@param resource    the resource to copy
@param propertyIds the set of requested property and category ids
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ResourceImpl.java